Skip to content

Comments

Support MultiLineString and fix pagination in Vantaa parking areas import#379

Merged
mhieta merged 1 commit intomainfrom
PL-153/vantaa-parking-areas-batch-fix
Feb 6, 2026
Merged

Support MultiLineString and fix pagination in Vantaa parking areas import#379
mhieta merged 1 commit intomainfrom
PL-153/vantaa-parking-areas-batch-fix

Conversation

@mhieta
Copy link
Contributor

@mhieta mhieta commented Feb 2, 2026

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:

  • Use pagination with batches in imports
  • Add MultiLineString geometry type handling
  • Fix SRID preservation in geometry conversions
  • Improve tests

Context

PL-153

How Has This Been Tested?

Via improved unit-tests.

Screenshots

Vantaa parking areas

@mhieta mhieta marked this pull request as ready for review February 2, 2026 08:39
@mhieta mhieta requested a review from a team as a code owner February 2, 2026 08:39
@mhieta mhieta marked this pull request as draft February 2, 2026 08:47
@azure-pipelines
Copy link

PALVELUKARTTA-API branch is deployed to platta: https://palvelukartta-api-pr379.dev.hel.ninja 🚀🚀🚀

@mhieta mhieta force-pushed the PL-153/vantaa-parking-areas-batch-fix branch from 4b55558 to 00aa8b5 Compare February 2, 2026 10:35
@mhieta mhieta marked this pull request as ready for review February 2, 2026 10:39
@mhieta mhieta marked this pull request as draft February 2, 2026 10:48
@mhieta mhieta force-pushed the PL-153/vantaa-parking-areas-batch-fix branch from 00aa8b5 to 4ced90d Compare February 2, 2026 10:57
@mhieta mhieta marked this pull request as ready for review February 2, 2026 10:59
@azure-pipelines
Copy link

PALVELUKARTTA-API branch is deployed to platta: https://palvelukartta-api-pr379.dev.hel.ninja 🚀🚀🚀

Copy link
Contributor

@danipran danipran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@mhieta mhieta force-pushed the PL-153/vantaa-parking-areas-batch-fix branch from 4ced90d to 39064f6 Compare February 6, 2026 07:06
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 6, 2026

@mhieta mhieta merged commit a879ec3 into main Feb 6, 2026
7 checks passed
@mhieta mhieta deleted the PL-153/vantaa-parking-areas-batch-fix branch February 6, 2026 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants