Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export as true .geojson, load with AJAX plugin #240

Open
reyemtm opened this issue Mar 30, 2015 · 3 comments
Open

Export as true .geojson, load with AJAX plugin #240

reyemtm opened this issue Mar 30, 2015 · 3 comments

Comments

@reyemtm
Copy link

reyemtm commented Mar 30, 2015

Forgive me if this has already been addressed, but I couldn't find it anywhere.

I love the plugin but it creates js files that are not true geojson files in that to use them again in qgis or some other software, you would have to rename them and edit them to take out the var parameter:

var exp_btrail = {
"type": "FeatureCollection",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, 

This also means that data that is already published online cannot be linked to for download. It would be great if there could be an option for, or just switch to as a default, exporting .geojson files. They could then be loaded with something like the geojson ajax plugin here.

Also, for points, they could just be exported as .csv files, as there is really no need for these to be in a true spatial format. For very large datasets I have heard that csv files load faster but have not verified this.

@tomchadwin
Copy link
Contributor

The exported files are JSONP, not JSON. This is commonly used so that remote data can be used in compliance with the same origin policy.

Can you explain further what you mean by "data that is already published online cannot be linked to for download"? If the data is being served by WFS, then it can be included, as long as the remote server can serve JSONP. If not, and the data is just static JSON, then browsers would not allow loading of it from a remote location. That is the reason JSONP was created, and is normally used.

Would you mind opening another issue for the CSV request?

@reyemtm
Copy link
Author

reyemtm commented Mar 31, 2015

The way the plugin is set up now, it is all served/linked as if it's on the same domain so I am not sure why there is a need to get around remote reources. Regardless it would be nice to have the option of exporting as .geojson, eventhough you are right in that the geojson would likely not load if the data folder was moved and hosted on a separate domain.

It would just be nice to have the file being mapped via leaflet be able to be downloaded and viewed in desktop gis software as is.

@tomchadwin
Copy link
Contributor

Using JSONP means that users have the option to host the files elsewhere, and everything will still work. This would not be the case with unpadded JSON. However, your argument does have merit.

@tomchadwin tomchadwin added the GUI label Apr 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants