Open Manriel opened 10 years ago
The existing format may play nice with leaflet or whatever is doing the drawing, but just to be clear, this JSON
[
{
"type":"polygon",
"latLngs":[
{"lat":35.66440930916498,"lng":-106.00459098815917},
{"lat":35.6898577188944,"lng":-105.95017433166504},
{"lat":35.651647189415,"lng":-105.97197532653809}
],
"color":"#a24ac3"
},
{
"type":"polyline",
"latLngs":[
{"lat":35.64997331752026,"lng":-106.00064277648924},
{"lat":35.63832498777987,"lng":-105.9587574005127}
],
"color":"#a24ac3"
}
]
would become this GeoJSON?
[
{
"type": "Polygon",
"coordinates": [[
[35.66440930916498, -106.00459098815917],
[35.6898577188944, -105.95017433166504],
[35.651647189415, -105.97197532653809]
]],
"properties": {
"color":"#a24ac3"
}
},
{
"type": "LineString",
"coordinates": [
[35.64997331752026,-106.00064277648924],
[35.63832498777987,-105.9587574005127]
],
"properties": {
"color":"#a24ac3"
}
}
]
I took a look at this, but although I support this, I didn't implement it yet, since it is more work than one would expect.
FeatureCollection
or GeometryCollection
containing more objects.Point
with property radius
.MultiPolygon
, MultiLineString
and some more. One could trim them down to standard polygons, lines and markers, but you would ultimately lose information or at least transform existing data upon import.Actually, Leaflet already has an implementation for parsing GeoJSON, but it uses primitive map features instead of there geodesic counterparts. Also, for the L.Multi*
classes, there is no geodesic implementation available.
I'm gonna take a look into that issue. I don't think we need perfect GeoJSON support, but it would be nice to be able to reuse exports from IITC with anything that is compatible to GeoJSON and to be able to import basic GeoJSON. Thus my plan would be the following:
Draw Tools in copy-paste-clear dialog need to support GeoJSON format and export data in GeoJSON format as default.
http://geojson.org/geojson-spec.html