File created with Feature to JSON won't work

2061
5
05-05-2020 12:15 PM
MartaBescansa1
New Contributor II

Hi,

I have created a .json file with the Feature to JSON tool on ArcGIS Pro 2.5, but it won't load on GitHub or geoJSON.io 

https://github.com/martabescansa7/Coursera_Capstone/blob/master/SSCC_MadridCapital_FeaturesT1.json

Coursera_Capstone/SSCC_MadridCapital_FeaturesT1.json at master · martabescansa7/Coursera_Capstone · ... 

I have been several days trying t fix this problem but nothing works. I really think it has something to do with the created .json file and its structure because other files work perfectly.

Please help.

Marta 

Tags (2)
0 Kudos
5 Replies
by Anonymous User
Not applicable

Hi Marta,

Hope you are well. This seems to be related to bug: BUG-000130522: Exporting data to GeoJSON using the Features to JSON geoprocessing tool adds extra decimal places for double and float fields.

I see that that there are some double fields in the JSON, specifically for the POB_TOTAL. Could you attempt the workaround: Uploading the data to ArcGIS Online and then exporting to GeoJSON provides the expected result, but requires a couple of extra steps

Use layers—ArcGIS Online Help | Documentation 

Please let me know if the workaround is successful.

Best, 

Luba

MartaBescansa1
New Contributor II

Dear Luba,

thanks for your response. I have tried it but it still doesn't work. I leave you my notebook in case you can have a look:

Coursera_Capstone/Choropleth map.ipynb at master · martabescansa7/Coursera_Capstone · GitHub 

the error it gives me is always the same. And this just happens with the .json files created with ESRI technology.

Many thanks,

Marta

0 Kudos
by Anonymous User
Not applicable

Hello Marta, 

Thank you for providing that information. From what I am understanding, you are getting the same result when doing Feature to JSON in Pro and when exporting to JSON in ArcGIS Online.

Is it always giving you the "Page could not be found 404" error each time you upload it? 

Thank you,

Luba

0 Kudos
by Anonymous User
Not applicable

Hi Marta,

I think it has something to do with the link that is being used. Could you confirm this behavior? 

When I go through my email to the GitHub, I follow this link: GitHub - martabescansa7/Coursera_Capstone: My Coursera Capstone project will be stored here  (this takes me to the GitHub page) When I go to the link that you provided me above, it takes me to the 404page: https://github.com/martabescansa7/Coursera_Capstone/blob/master/Choropleth%20map.ipynb 

I went to each of the .json files and was able to open them without error. Which file is giving error on your github page? 

Thank you,

Luba

0 Kudos
MartaBescansa1
New Contributor II

Hi Luba,

I finally understood what was going on.

First, in order to make a GeoJSON file work, these two boxes must be clicked when using the Feature to JSON tool. 

Second, in order to import it in pandas and use it with other libraries such as Folium, what I did was change the extension of the GEOJSON file to JSON and open the file using the raw GitHub URL, which allows you to access the file directly (this can be done by clicking the 'Raw' button on the page). I found the solution here: sql - importing json file from github into python. Getting Error: JSONDecodeError: Expecting value: ... 

So basically, there is nothing wrong with the Features to JSON  tool, but there are some things that need to be explained in order to make the files work outside of ArcGIS Pro.

Many greetings and thank you very much for your help.

Marta

0 Kudos