hackoregon / transportation-backend

Transportation backend repo - 2016 and 2017
8 stars 7 forks source link

Create artificial project id for csv imports #33

Open sanjuroj opened 7 years ago

sanjuroj commented 7 years ago

When we import the city APIs from the Open Data Portal, Multi- point, line, and polygon objects come through as individual rows. So a multipoint feature is presented in the GeoJson as two features with the same project id but different coordinates.

When we identify conflicts, we can exclude features that belong to the same project by checking whether their project numbers are the same. The CSV imports don't seem to have this kind of project id field. In order to avoid including multipoint features in the conflict listing, we need to create an artificial project id that we can use to filter the multi- geometries.

Part of this change is that we probably need to provide an entry in the meta data constants that identies the field name for the project id field, since the name of this field may be different in each data source we load.