Support MultiLineString and fix pagination in Vantaa parking areas import#379
Support MultiLineString and fix pagination in Vantaa parking areas import#379
Conversation
|
PALVELUKARTTA-API branch is deployed to platta: https://palvelukartta-api-pr379.dev.hel.ninja 🚀🚀🚀 |
4b55558 to
00aa8b5
Compare
00aa8b5 to
4ced90d
Compare
|
PALVELUKARTTA-API branch is deployed to platta: https://palvelukartta-api-pr379.dev.hel.ninja 🚀🚀🚀 |
There was a problem hiding this comment.
I guess it works, but the heavy use of call_command("update_vantaa_parking_areas") and @patch("restapi.FeatureService") in the test code makes me wonder if there's room for refactoring in the production code. E.g. in update_vantaa_parking_areas.Command, can update_parking_areas be split to multiple methods or could handle have more than one step?
The functionality we're trying to test in some of the tests are quite specific (or at least seem like it), but the method used is very broad. For example. there's a test called test_ocd_id_format and to test that functionality, we use call_command("update_vantaa_parking_areas"). It's like using a machete instead of a scalpel for a precision surgery. The way the production code is structured forces you to do that though, so that's why I'm wondering about the refactoring aspect. And I don't mean that you need to refactor the whole code, but at least some parts (if applicable).
But as I said, this all seems to work, so if this is something that needs to go live ASAP, then I suppose it's fine as it is.
- Use pagination with batches in imports - Add MultiLineString geometry type handling - Fix SRID preservation in geometry conversions - Improve tests Refs: PL-153
4ced90d to
39064f6
Compare
|



Description
Some parking areas in Vantaa were not visible in the service map.
The root cause was that the underlying ArcGIS Server import-library by default was using a hard-limit of 1000 features per layer and one layer had more features than that.
This PR fixes the import to use pagination and therefore all features get fetched from the source. This fixes the import to work as intended.
Details:
Context
PL-153
How Has This Been Tested?
Via improved unit-tests.
Screenshots