gtt-project/redmine_gtt

GeoJSON file only display the first area

yan-you opened this issue · 3 comments

I select two areas in QGIS and export them as GeoJSON files,
Then paste it by Upload GeoJSON,
The preview shows all the regions I have selected(first image),
But after saving only the first area remains, the other area disappears(second image).

Information :
Virtual host : QEMU/KVM
Operating system : Ubuntu 20.44
Redmine version : 5.0.2stable
Ruby version : 3.1.4-p223 [x86_64-linux]
Rails version : 6.1.6
redmine_gtt version : 5.0.0
Database : PostGIS

1.Before saving it shows all the regions I have selected.
01
2.After saving only the first area remain.
02

GeoJSON:
{
"type": "FeatureCollection",
"name": "area_edit",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{ "type": "Feature", "properties": { }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 120.693253549578841, 24.20066970159969 ], [ 120.693265157012434, 24.19933774859501 ], [ 120.69059544728627, 24.19933774859501 ], [ 120.690609956578257, 24.200687112750078 ], [ 120.693253549578841, 24.20066970159969 ] ] ] ] } },
{ "type": "Feature", "properties": { }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 120.693248713148122, 24.199281645999314 ], [ 120.693256451437193, 24.197865539101091 ], [ 120.690590610855566, 24.197881015679215 ], [ 120.690602218289158, 24.199277776854782 ], [ 120.693248713148122, 24.199281645999314 ] ] ] ] } }
]
}

Thanks

sanak commented

@yan-you (CC: @dkastl, @smellman)
Thanks for your feedback!
This is a known issue (#118 (comment)) when uploaded GeoJSON has multiple features, because currently, 1 project stores 1 feature's geometry.

So, could you try to collect multiple features to a single feature from [Vector]/[Geometry Tools]/[Collect Geometries...] menu in QGIS ?
qgis-collect-geometries

Here is the processed GeoJSON on my local environment, and I confirmed that all 2 geometries are stored.

{
"type": "FeatureCollection",
"name": "issue251-collected-multipolygons",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{ "type": "Feature", "properties": { }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 120.693253549578841, 24.20066970159969 ], [ 120.693265157012434, 24.19933774859501 ], [ 120.69059544728627, 24.19933774859501 ], [ 120.690609956578257, 24.200687112750078 ], [ 120.693253549578841, 24.20066970159969 ] ] ], [ [ [ 120.693248713148122, 24.199281645999314 ], [ 120.693256451437193, 24.197865539101091 ], [ 120.690590610855566, 24.197881015679215 ], [ 120.690602218289158, 24.199277776854782 ], [ 120.693248713148122, 24.199281645999314 ] ] ] ] } }
]
}

@sanak
Thanks for your reply,it's working now.

sanak commented

Okay, thanks for confirmation.