Phrogz / svg2geojson

Converts an SVG file with added geo-referencing tags into one or more GeoJSON files.
MIT License
59 stars 30 forks source link

Geo Item X Y example #10

Open kk12837 opened 4 years ago

kk12837 commented 4 years ago

Hi

Can anyone provide an example of X Y in GeoItem.

I am not sure how to implement it, Attached with a china map.

Thanks

Keith map2.svg.txt

RodeoAdrian commented 2 years ago

Hey, same question. Is someone maintaining this repo? I don't know how to get X and Y values. I only have Lat and Long from Google maps

kitpaddle commented 2 years ago

Alright, I'll leave a comment here explaining a few things as I had a few issues getting this (awesome) little converter to work. If like me you're not quite skilled (or patient) enough to adapt the code to your needs, or append the SVG file with the Geo Metadata, here is how you can do it with relatively simple tools:

First I recommend using INKSCAPE to edit/prepare your SVG file.

Now save your document. This should be an .svg file wherever you saved it. We will now have to edit that and add the geodata.

Then just save the file.

Last comment, keep in mind that if you have complex shapes in your svg they might be converted to geojson but might no actually work in a geojson viewer because, as said in the readme, multipolygons and other complex paths cannot be handled by the converter at the moment. (It will "convert" them but the geojson won't actually work correctly). For simple polygons and lines it works fine =)

Hope this helps someone who has gotten stuck here! Good luck