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

Support for Line & Polygon? #19

Open
StefanJaq opened this issue Mar 8, 2017 · 9 comments
Open

Support for Line & Polygon? #19

StefanJaq opened this issue Mar 8, 2017 · 9 comments
Labels

Comments

@StefanJaq
Copy link

Does "JSON to Features" only support Point-Features?
I allways get an error: "sequence size must match size of the row" when trying to convert a polygon.
I created the json with the "Features to JSON" tool with a very simple polygon featureclass.
The json-file is attached, (just rename the txt to json).

Poly_WGS84_Enclosed_Formatted.txt

@randallwhitman
Copy link
Contributor

JSON To Features is expected to work with all of Point, Line, and Polygon.
In fact, Vehicle Trip Discovery with GIS Tools for Hadoop shows an example with Polygon.

@StefanJaq
Copy link
Author

Thanks Randall, I will check that link.
The funny thing is:
I export a Poly-FC with the tool "Feature to JSON" (attached in the post above).
So I would expect that this JSON-file should be a valid input for the tool "JSON to Features". But it throws an error ("sequence size must match size of the row").

@randallwhitman
Copy link
Contributor

That does not sound right.
@azhigimont

@azhigimont
Copy link
Member

hmmm... let me see

@azhigimont
Copy link
Member

azhigimont commented Mar 17, 2017

Here we go.
The provided file contains fields named SHAPE_Length, SHAPE_Area while the code checks for Shape_Length and Shape_Area (which is the way it's spelled in FGDB). It's easy to fix.
I wonder, where the alternative spelling is coming from?

@StefanJaq
Copy link
Author

StefanJaq commented Mar 20, 2017

Thanks for the Research.
The fGDB and the FC were created with ArcGIS (ArcCatalog) 10.5 and the fieldnames are written SHAPE_Length, SHAPE_Area.
Now I changed the filednames in the JSON and now it works. Thanks for the hint.

@azhigimont
Copy link
Member

azhigimont commented Mar 20, 2017

@StefanJaq Thanks, I can see it now. I've installed a quick fix for this issue. Please pull the latest code from the repo & let us know it it works for you!

@StefanJaq
Copy link
Author

Sorry, the quick fix doesn't really solve the issue. I still get the same error ("sequence size must match size of the row") when trying to import the JSON.
The output json-file itself seems now right. SHAPE_Length and SHAPE_Area are spelled in the same manner in the whole file.

@StefanJaq
Copy link
Author

@azhigimont Any idea why it didn't help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants