wavded / ogre

ogr2ogr geojson-focused web client
http://ogre.adc4gis.com
MIT License
266 stars 78 forks source link

Coordinates seem to be off? #32

Closed pardis9 closed 9 years ago

pardis9 commented 9 years ago

Hello :)

I've downloaded an ESRI ArcGIS shape file from http://cityplanning.lacity.org/, and then I uploaded and converted the zipped file to GeoJSON with your lovely online converter (thanks so much!), but when I try adding the converted GeoJSON data to Google Maps as a data layer at https://developers.google.com/maps/documentation/javascript/examples/layer-data-dragndrop, it doesn't work.

And the Google Maps page works perfectly with native (unconverted) GeoJSON files downloaded from the LA Times' mapping project at http://boundaries.latimes.com/sets/.

Just wondering if I'm doing something wrong or if there's a concept I'm not grasping?

Thanks so much for everything! You rock!

Pardis

wavded commented 9 years ago

@pardis9 it sounds like a projection issue. Can you tell me what coordinate system the source and destination should be in? Even better, point me to a specific feature you get back from the shapefile that isn't correct.

pardis9 commented 9 years ago

@wavded I'm a bit beyond my depths, here, but I think you're right. This post seems to reference the same question: http://gis.stackexchange.com/questions/52209/which-coordinate-system-and-projection-shall-i-use-for-georeferencing-google-map

Here's a polygon representing the 90068 zip code in the Hollywood Hills that works when used in Google Maps:

{ "type": "Feature", "properties": { "kind": "ZIP Code Tabulation Area (2012)", "external_id": "90068", "name": "90068", "slug": "90068-zip-code-tabulation-area-2012", "set": "/1.0/boundary-set/zip-code-tabulation-areas-2012/", "metadata": {"AWATER10": 470986, "CLASSFP10": "B5", "ALAND10": 19730984, "INTPTLAT10": "+34.1297719", "FUNCSTAT10": "S", "ZCTA5CE10": "90068", "MTFCC10": "G6350", "GEOID10": "90068", "INTPTLON10": "-118.3309888"}, "resource_uri": "/1.0/boundary/90068-zip-code-tabulation-area-2012/" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ -118.353618, 34.125452 ], [ -118.359404, 34.125729 ], [ -118.360488, 34.126109 ], [ -118.360677, 34.12635 ], [ -118.360349, 34.127348 ], [ -118.359944, 34.127584 ], [ -118.359668, 34.128176 ], [ -118.359856, 34.12847 ], [ -118.360408, 34.128522 ], [ -118.360602, 34.128725 ], [ -118.362837, 34.129007 ], [ -118.36332, 34.128236 ], [ -118.365299, 34.128872 ], [ -118.366056, 34.128968 ], [ -118.364473, 34.131998 ], [ -118.367879, 34.134617 ], [ -118.366517, 34.136775 ], [ -118.364682, 34.136904 ], [ -118.36412, 34.137223 ], [ -118.363309, 34.137209 ], [ -118.361173, 34.134967 ], [ -118.360855, 34.135358 ], [ -118.360824, 34.135683 ], [ -118.362006, 34.136994 ], [ -118.360063, 34.135569 ], [ -118.358836, 34.134932 ], [ -118.355244, 34.133785 ], [ -118.352516, 34.133106 ], [ -118.352429, 34.133333 ], [ -118.351758, 34.133057 ], [ -118.350491, 34.132291 ], [ -118.349034, 34.130939 ], [ -118.348405, 34.131988 ], [ -118.348657, 34.132464 ], [ -118.348453, 34.132885 ], [ -118.347462, 34.133144 ], [ -118.347774, 34.133465 ], [ -118.346714, 34.133891 ], [ -118.346717, 34.134193 ], [ -118.346489, 34.134351 ], [ -118.346564, 34.134646 ], [ -118.345861, 34.134677 ], [ -118.345576, 34.135109 ], [ -118.344213, 34.136061 ], [ -118.344424, 34.136801 ], [ -118.344028, 34.137849 ], [ -118.34323, 34.138214 ], [ -118.345038, 34.142446 ], [ -118.345665, 34.142367 ], [ -118.345691, 34.142572 ], [ -118.344779, 34.142944 ], [ -118.342313, 34.144811 ], [ -118.34074, 34.145514 ], [ -118.339992, 34.14559 ], [ -118.338804, 34.145228 ], [ -118.336637, 34.146494 ], [ -118.331028, 34.148318 ], [ -118.330067, 34.149747 ], [ -118.329026, 34.150181 ], [ -118.325721, 34.153253 ], [ -118.32211, 34.155727 ], [ -118.317677, 34.156313 ], [ -118.315818, 34.154453 ], [ -118.312906, 34.153993 ], [ -118.312615, 34.154477 ], [ -118.310878, 34.15485 ], [ -118.311041, 34.154272 ], [ -118.311835, 34.153149 ], [ -118.310986, 34.152951 ], [ -118.310301, 34.15304 ], [ -118.309753, 34.153302 ], [ -118.309232, 34.153797 ], [ -118.309295, 34.154368 ], [ -118.309098, 34.154736 ], [ -118.307726, 34.155223 ], [ -118.308828, 34.153807 ], [ -118.308895, 34.153062 ], [ -118.308759, 34.152677 ], [ -118.309169, 34.15175 ], [ -118.309326, 34.150566 ], [ -118.309203, 34.150201 ], [ -118.308791, 34.149811 ], [ -118.308525, 34.14908 ], [ -118.309029, 34.148461 ], [ -118.309699, 34.148239 ], [ -118.30988, 34.147919 ], [ -118.309363, 34.145015 ], [ -118.307702, 34.143628 ], [ -118.309251, 34.142667 ], [ -118.306834, 34.141288 ], [ -118.306589, 34.140158 ], [ -118.307639, 34.13956 ], [ -118.307124, 34.138873 ], [ -118.305608, 34.140207 ], [ -118.304995, 34.139819 ], [ -118.306486, 34.137681 ], [ -118.309158, 34.139006 ], [ -118.305609, 34.136007 ], [ -118.303009, 34.134607 ], [ -118.302709, 34.133907 ], [ -118.301809, 34.134207 ], [ -118.301009, 34.131607 ], [ -118.304309, 34.130807 ], [ -118.305909, 34.129108 ], [ -118.304209, 34.128208 ], [ -118.306909, 34.126108 ], [ -118.304009, 34.125308 ], [ -118.302009, 34.123608 ], [ -118.302409, 34.123408 ], [ -118.304609, 34.124808 ], [ -118.306309, 34.124508 ], [ -118.306909, 34.122908 ], [ -118.307409, 34.123408 ], [ -118.308809, 34.120108 ], [ -118.307909, 34.119308 ], [ -118.308109, 34.118108 ], [ -118.308609, 34.117808 ], [ -118.308309, 34.117308 ], [ -118.308809, 34.116508 ], [ -118.307909, 34.115008 ], [ -118.307109, 34.117508 ], [ -118.306509, 34.116808 ], [ -118.307509, 34.113408 ], [ -118.307192, 34.110778 ], [ -118.307347, 34.109721 ], [ -118.30797, 34.108521 ], [ -118.307647, 34.108082 ], [ -118.309297, 34.107687 ], [ -118.309282, 34.105381 ], [ -118.312592, 34.105374 ], [ -118.312592, 34.105797 ], [ -118.313053, 34.105801 ], [ -118.31365, 34.10579 ], [ -118.313649, 34.105349 ], [ -118.314739, 34.105284 ], [ -118.314741, 34.107365 ], [ -118.315795, 34.107731 ], [ -118.315814, 34.105265 ], [ -118.323982, 34.105241 ], [ -118.323985, 34.105667 ], [ -118.325214, 34.10562 ], [ -118.325218, 34.105197 ], [ -118.32666, 34.105208 ], [ -118.327811, 34.105448 ], [ -118.329274, 34.105252 ], [ -118.333346, 34.105197 ], [ -118.333353, 34.106422 ], [ -118.333643, 34.106542 ], [ -118.334357, 34.106278 ], [ -118.334527, 34.105992 ], [ -118.336415, 34.105976 ], [ -118.336399, 34.105654 ], [ -118.336069, 34.105181 ], [ -118.337471, 34.105173 ], [ -118.337685, 34.104567 ], [ -118.338368, 34.104136 ], [ -118.339396, 34.104128 ], [ -118.3394, 34.104815 ], [ -118.34017, 34.104813 ], [ -118.340165, 34.104126 ], [ -118.342809, 34.104119 ], [ -118.342812, 34.104632 ], [ -118.343604, 34.105899 ], [ -118.344158, 34.105759 ], [ -118.34386, 34.104116 ], [ -118.34484, 34.104012 ], [ -118.34535, 34.105305 ], [ -118.344616, 34.105735 ], [ -118.345372, 34.107024 ], [ -118.345593, 34.107698 ], [ -118.345598, 34.108412 ], [ -118.346181, 34.11122 ], [ -118.346009, 34.111655 ], [ -118.34553, 34.111884 ], [ -118.345568, 34.112067 ], [ -118.345851, 34.112538 ], [ -118.346272, 34.112847 ], [ -118.347265, 34.112954 ], [ -118.34689, 34.113363 ], [ -118.347158, 34.113588 ], [ -118.347397, 34.114903 ], [ -118.348081, 34.115118 ], [ -118.348715, 34.115827 ], [ -118.349099, 34.117433 ], [ -118.349053, 34.117912 ], [ -118.349838, 34.118758 ], [ -118.350462, 34.118763 ], [ -118.350462, 34.120002 ], [ -118.351089, 34.120064 ], [ -118.351688, 34.119838 ], [ -118.352274, 34.119819 ], [ -118.352018, 34.120125 ], [ -118.352211, 34.120304 ], [ -118.354092, 34.120974 ], [ -118.354593, 34.121371 ], [ -118.355329, 34.12145 ], [ -118.356209, 34.12205 ], [ -118.356222, 34.122289 ], [ -118.355113, 34.12356 ], [ -118.3553, 34.122849 ], [ -118.354834, 34.122832 ], [ -118.354667, 34.122554 ], [ -118.354253, 34.122723 ], [ -118.354004, 34.123301 ], [ -118.353698, 34.12355 ], [ -118.353353, 34.123561 ], [ -118.351561, 34.122588 ], [ -118.351305, 34.122702 ], [ -118.351234, 34.123542 ], [ -118.351562, 34.124081 ], [ -118.351568, 34.124477 ], [ -118.351836, 34.124738 ], [ -118.351755, 34.125349 ], [ -118.353618, 34.125452 ] ] ] ] } }

pardis9 commented 9 years ago

@wavded OK, I think I found what the source ESRI ArcGIS data uses:

Projected GCS_North_American_1983 Linear Unit: Foot_US (0.304801) NAD_1983_StatePlane_California_V_FIPS_0405_Feet PROJCS["NAD_1983_StatePlane_California_V_FIPS_0405_Feet",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",6561666.666666666],PARAMETER["False_Northing",1640416.666666667],PARAMETER["Central_Meridian",-118.0],PARAMETER["Standard_Parallel_1",34.03333333333333],PARAMETER["Standard_Parallel_2",35.46666666666667],PARAMETER["Latitude_Of_Origin",33.5],UNIT["Foot_US",0.3048006096012192],AUTHORITY["EPSG",2229]]4000000-100000010001010.0222false2229

Elsewhere in the same XML file:

- - - coordinate pair - 0.010000 0.010000 survey feet - North American Datum of 1983 Geodetic Reference System 80 6378137.000000 298.257222 - GCS_North_American_1983 NAD_1983_StatePlane_California_V_FIPS_0405_Feet - - 1.000000 Explicit elevation coordinate included with horizontal coordinates
pardis9 commented 9 years ago

@wavded I think I got it!!

Source: EPSG: 2229 Target: EPSG: 4326

Seems to work, anyway :)

wavded commented 9 years ago

great! let me know if you have any other issues, closing.