Closed calvinmetcalf closed 11 years ago
likely would have been easier w/ those libraries, but i am not that bright to have recognized it. your code is clean, looks good. my project was a bit of playing around, but looking at yours makes me think there is some more to gain. thanks for sharing.
Haha no problem I created mine for pretty much the same reason, the csv.DictReader class would probably allow you to share almost all of the code between JSON and csv.
sweet; i'll look at it more. did you have any problems w/ inside rings or anything like that?
I wrote that a while ago, I did have problems with inside rings when I was converting from esriJSON to geoJSON, I don't think I bothered dealing with them in the python tool, I also apparently didn't believe in for-loops.
lol; your style is beautiful; terse. again, nice job. i'll take some things from it.
I think I was writing a lot of CoffeeScript at the time.
I double checked your script against a large data set with multi-polygons and donuts it somewhat it ended up just not giving geometries back, which is better then mine which just erred on on the date object and then after fixing that it turned out no I didn't deal with donuts.
btw I managed to get donut holes working in the most recent version.
oh, sweet! i was trying to tick these off one at a time, and juggling other things. i was going to look at this issue tomorrow. but it it is all good, then cool. will this be useful for you?
I was just closing this because it wasn't really an issue as much as a discussion thread, I managed to get holes to work here, basically you need to split the polygon at the missing point and start a new array, to avoid the conection between the outside and inside. Also I learned the hard way you need to check the length of the polygon that esri gives you as ESRI allows polygons that only have one point (length of 2 because the first and last point are repeated) but GeoJSON requires minimum of 3 distinct points (length of 4)
right; i had thought of requiring an esri repair geometry as part of the script, but the drawback there is that changes data. i figure it is better to have a workflow whereby the user actually controls what they want to do. i guess an enhancement would be to have a) check geometry run first, and if any errors occur, bail and let the use fix them and b) if geometry is null, skip entire row or something like that.
btw, nice use of stamen tiles.
I Was thinking one point polygons would just be turned into points and if part of a multipolygon a geometry collection
maybe this will be more clear:
that looks right, and is killing me. very funny/appropriate
the real joke is that that isn't complete as I bet ESRI handles polylines with only 1 point
also sadly that wasn't made as a joke as much as an illfated attempt to track the progress of my tool. calvinmetcalf/esri2geo#10
Speaking of which, would you be interested in merging esri2open and esri2geo it looks like we pretty much have the exact same goals.
Would it be easier to use python's built in CSV and JSON libraries?
I made a similar library and managed to save a lot of logic by doing that.
This is half an issue and half me
trying to figure out ifparanoid I missed some downside of using the json library.