umap icon indicating copy to clipboard operation
umap copied to clipboard

[wishlist] Please export layer information in .geojson

Open yohanboniface opened this issue 10 years ago • 10 comments

Originally reported by: BitBucket: maniacbug, GitHub: maniacbug


Layers are a great organizational technique for markers/etc. Unfortunately, they are lost when exported. Perhaps the layer name could be included in the "properties" for each point.


  • Bitbucket: https://bitbucket.org/yohanboniface/umap/issue/174

yohanboniface avatar Mar 24 '15 05:03 yohanboniface

There is now a "umap" format to export data and metadata.

yohanboniface avatar Dec 21 '16 18:12 yohanboniface

The umap format does not fix this (afaik) if you want to re-use your data in another setting, say in QGIS.

joostschouppe avatar Jun 22 '17 09:06 joostschouppe

Can you clarify what you want to do and what is missing for this?

Situation: there is an "all data" geojson export and a uMap one (indeed dedicated for reuse in uMap)).

yohanboniface avatar Jun 22 '17 09:06 yohanboniface

I made a umap instance with about 1000 objects to verify in the field. I put these objects in a layer called "to verify". Then I made two empty layers ("verified", "special cases"), to which the terrain worker could move these objects. I now want to use this data for statistical analysis, so I'm working towards a structured table. I was trying to do this by exporting the geojson, then exporting the attribute table to a flat format like csv. But to get this to work, I had to manually fill an a new field.

It would have been fine for me if:

  • the geojson contained an attribute with the layer name
  • a single layer could be exported to a single geojson
  • I would be able to open a umap file in QGIS
  • I would be smart enough to write a .umap parser in 15 minutes

Come to think of it, I could have taken the umap file, and use it to make a new umap instance. Then empty all the layers except one, then export as geojson.

EDIT: I don't know if I changed something, but when I make layers invisible now, I do get an export of visible layers only. So that is in fact good enough for me.

joostschouppe avatar Jun 22 '17 09:06 joostschouppe

a single layer could be exported to a single geojson

This is possible (but a bit click greedy): when exporting in geojson, only the visible layers will be considered, so you can export layers one by one by only showing them one by one.

Does it help?

yohanboniface avatar Jun 22 '17 09:06 yohanboniface

Yes, as I indicated in my edit, this is OK for me. It just didn't work the first time I tried.

joostschouppe avatar Jun 22 '17 09:06 joostschouppe

I also would find it valuable if the layer name was included in the GeoJSON export. Either like this:

properties: {
    _layer: "myLayer"
}

or like this:

{
   type: "Feature",
   layer: "myLayer",
   properties: {...},
   geometry: {...}
}

Having it only in the "umap" format means you then need to convert that into GeoJSON.

stevage avatar Dec 04 '18 03:12 stevage

@stevage Since this issue is closed since almost two years, I would suggest to open a new one.

almereyda avatar Dec 08 '18 14:12 almereyda

{
   type: "Feature",
   layer: "myLayer",
   properties: {...},
   geometry: {...}
}

Sounds legit, I'll have a try on it.

yohanboniface avatar Dec 08 '18 14:12 yohanboniface