TerriaJS / nationalmap

Australia's NationalMap
https://nationalmap.gov.au
122 stars 45 forks source link

Adding shapefiles to NationalMap #1257

Closed dbutrovski closed 2 weeks ago

dbutrovski commented 6 months ago

If understood correctly it is suggested improvement to enable upload of user shapefiles from a location other than local PC. Here is the complete user email:

[snip email header] Hello, I've got a professional background in cartography / spatial information and was interested in adding ESRI Shapefiles I have created with GIS software to the National Map.

I have created files at https://github.com/johncleverdon/RFI/ but when in NationalMap, using the Upload -> My Data -> Add Web Data option to do this, I get an error message reading: "A network request error occurred Data may not be available or display correctly due to data custodian's service outage. Please try reloading the map, accessing the data at a later stage, or selecting a different dataset." and under Developer Details, the following: "Data could not be added An error occurred while loading the catalog item. Failed to load https://github.com/johncleverdon/RFI/RFI_EastWestRail_Stage1.zip mapItems Data may not be available or display correctly due to data custodian's service outage. Please try reloading the map, accessing the data at a later stage, or selecting a different dataset. An error occurred parsing the provided data as JSON. This may indicate that the file is invalid or that it is not supported. Request has failed. value@https://nationalmap.gov.au/build/3.TerriaMap.js:1:197666 De/e/<@https://nationalmap.gov.au/build/3.TerriaMap.js:68:151134 c@https://nationalmap.gov.au/build/3.TerriaMap.js:68:133295 fe/w/<@https://nationalmap.gov.au/build/3.TerriaMap.js:68:134652 fe/v/</<@https://nationalmap.gov.au/build/3.TerriaMap.js:68:133658 de@https://nationalmap.gov.au/build/3.TerriaMap.js:68:139302 s@https://nationalmap.gov.au/build/3.TerriaMap.js:68:139545 This may indicate one of the following: • The server hostname could not be resolved • The server did not respond to the request - or is temporarily unavailable • The server denied Cross-Origin Resource Sharing (CORS) access to this URL • There is a problem with your internet connection If you entered the link manually, please verify that the link is correct."

How am I able to successfully able to add this data to share, please? I was thinking of having something like a much simpler version of https://nationalmap.gov.au/#share=s-m4XpUHiSNri3DgNW2yruuismGtq (which is why I chose GitHub to locate my data). Thanks, [snip signature block]

nf-s commented 4 months ago

Hi @dbutrovski

Sorry for the delayed response.

The issue here is with the shapefile URL - in order to use files stored in a GitHub repository, you must use their CDN URL

For example

The CDN URL can also be found by clicking the "Raw" button

image

You can see the CDN URL working in this share-link

Thanks!

nf-s commented 2 weeks ago

I'm going to close this, we can re-open if more info is needed