nationalmap icon indicating copy to clipboard operation
nationalmap copied to clipboard

Adding shapefiles to NationalMap

Open dbutrovski opened this issue 1 year ago • 1 comments

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]

dbutrovski avatar Jan 03 '24 21:01 dbutrovski

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

  • https://github.com/johncleverdon/RFI/blob/main/RFI_EastWestRail_Stage1.zip
  • Becomes https://raw.githubusercontent.com/johncleverdon/RFI/main/RFI_EastWestRail_Stage1.zip

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

image

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

  • https://nationalmap.gov.au/#share=s-q0GWvZ0GueSoKU6m9CaPstgNnqb

Thanks!

nf-s avatar Feb 12 '24 02:02 nf-s

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

nf-s avatar Jun 12 '24 04:06 nf-s