Answer the question
In order to leave comments, you need to log in
How to convert SVG polygons and rectangles to geoJSON?
Hello,
There is a simple floor plan editor - it is an SVG for the height \ width of the container, where the user can draw \ delete \ copy polygons and rectangles with the mouse. The floor plan itself is a base64 encoded image pasted into an SVG. All this works on d3 and looks something like this:
The customer wants all this stuff to be stored in geoJSON format. Question - how, what to use? I tried to google, read the d3 documentation - basically the reverse options are described everywhere, how geoJSON is converted to SVG. Moreover, complex three-dimensional projections are usually used, which I clearly do not need for a flat plan.
Am I not looking there? Or geoJSON is not relevant at all in this case? Suggest something.
Thanks a lot.
Answer the question
In order to leave comments, you need to log in
What are the problems? Get all the objects on the canvas with their coordinates and shape type, and convert them to the form
{
"type": "Polygon",
"coordinates": [
]
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question