Skip to content

Commit

Permalink
Enable to upload geojson with id attribute with non-unique values. Cl…
Browse files Browse the repository at this point in the history
…oses #380
  • Loading branch information
index-git authored and jirik committed Sep 1, 2021
1 parent a8ed5c4 commit 94b9312
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
- `ground_sample_distance` used for raster data
- Metadata property `scale_denominator` was removed. Its value is now accessible as subproperty of new [`spatial_resolution`](doc/metadata.md#spatial_resolution) metadata property.
- [#418](https://github.com/LayerManager/layman/issues/418) Combination of none geometry type in layer file and any geometry type in qml file is from now allowed.
- [#380](https://github.com/LayerManager/layman/issues/380) Enable to upload geojson with "id" attribute with non-unique values.
## v1.13.2
2021-06-25
Expand Down
11 changes: 11 additions & 0 deletions sample/layman.layer/small_layer_with_id.geojson
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"type": "FeatureCollection",
"name": "small_layer",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{ "type": "Feature", "properties": { "cartodb_id": 24, "id": 1 }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 14.1149, 48.969585 ], [ 14.114936, 48.96959 ], [ 14.114867, 48.969513 ], [ 14.1149, 48.969585 ] ] ] ] } },
{ "type": "Feature", "properties": { "cartodb_id": 165, "id": 1 }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 14.114496, 48.966783 ], [ 14.114473, 48.966654 ], [ 14.114369, 48.966661 ], [ 14.114392, 48.966791 ], [ 14.114496, 48.966783 ] ] ] ] } },
{ "type": "Feature", "properties": { "cartodb_id": 181, "id": 1 }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 14.119754, 48.97045 ], [ 14.11929, 48.970293 ], [ 14.119146, 48.970276 ], [ 14.118926, 48.970299 ], [ 14.118698, 48.970322 ], [ 14.11838, 48.970346 ], [ 14.118229, 48.970323 ], [ 14.118331, 48.970612 ], [ 14.118714, 48.970511 ], [ 14.118825, 48.970489 ], [ 14.119085, 48.970414 ], [ 14.119341, 48.970397 ], [ 14.119895, 48.970517 ], [ 14.119754, 48.97045 ] ] ] ] } },
{ "type": "Feature", "properties": { "cartodb_id": 573, "id": 1 }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 14.125504, 48.964832 ], [ 14.125418, 48.964941 ], [ 14.126555, 48.966056 ], [ 14.126595, 48.966031 ], [ 14.126774, 48.965931 ], [ 14.126824, 48.965822 ], [ 14.126577, 48.965577 ], [ 14.126007, 48.965189 ], [ 14.125504, 48.964832 ] ] ] ] } }
]
}
1 change: 1 addition & 0 deletions src/layman/layer/db/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ def import_layer_vector_file_async(username, layername, main_filepath,
'-lco', f'SCHEMA={username}',
# '-clipsrc', '-180', '-85.06', '180', '85.06',
'-f', 'PostgreSQL',
'-unsetFid',
f'PG:{pg_conn}',
# 'PG:{} active_schema={}'.format(PG_CONN, username),
]
Expand Down
4 changes: 3 additions & 1 deletion tests/static_publications/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
},
(OWNER, LAYER_TYPE, 'post_private_sld'): {
DEFINITION: [
{'headers': HEADERS[OWNER]},
{'headers': HEADERS[OWNER],
'file_paths': ['sample/layman.layer/small_layer_with_id.geojson'],
},
],
TEST_DATA: {
'bbox': (1571204.369948366, 6268896.225570714, 1572590.854206196, 6269876.33561699),
Expand Down

0 comments on commit 94b9312

Please sign in to comment.