2

I have created some KML files by converting the projection with both ARC and MapWindow. I'm looking for ways to automate exporting the data from our application with coordinates in State Plane "ESRI:102272" to something that can be used in Google Earth.

While I'm not a GIS Pro or a Web Developer, I know just enough to export and create maps.

I'm looking to create some kml files to share on our webserver. Can proj4js be used to convert the coordinates within the file?

Any thoughts on this process would be greatly appreciated.

2
  • ESRI: 102272 is also EPSG: 2791 (we changed its well-known ID) in ArcGIS back around 9.1. It's NAD83(HARN) / Illinois West aka NAD_1983_HARN_Stateplane_Illinois_West_FIS_1202
    – mkennedy
    Commented Sep 6, 2012 at 18:17
  • 1
    Are you looking for fully automated process, or are you comfortable with some level of scripting? If I gave you little python snippet, could you use it?
    – user890
    Commented Sep 8, 2012 at 12:25

3 Answers 3

2

You can use OGR to convert to a kml. I assume (not totally sure) that reprojection is inherent because kml always has to be in EPSG:4326. Use:

ogr2ogr -f kml -t_srs EPSG:4326 output.kml input.shp

You may/may not need -t_srs EPSG:4326. You can use this call in a batch script to generate your kml files.

If you just want to reproject the points, then you cs2cs or gdaltransform (which is a wrapper for cs2cs that accepts more than just proj.4 strings.

www.gdal.org

1

You wouldn't use Proj4js (the "js" part is Javascript, so client-side browser stuff)...but you can use Proj4. http://trac.osgeo.org/proj/

It'd make more sense to convert your coordinates before you put them into KML. KML expects values to be in Decimal Lat/Lon/Elevation, so no point creating KML with "bad" projection and then converting.

So you could do a 1-time process inside your database and re-project all the columns, and then whenever new values are entered you re-project them and enter in some shadow columns, or you can do it during export. Implementation depends on how you "export" the data out of your applications. But you should be able to hook it up to proj4 or cs2cs (see proj4).

1
  • This does make more sense, thanks for the feedback. I’ve looked at the Proj4 site and have found some excellent information. It has also opened up additional searches to other automated tools that may benefit someone working in a non-GIS position like myself. As I research these and find a solution, I will post the results. Thanks again….
    – Rich
    Commented Sep 7, 2012 at 13:32
0

Use the database spatial functions. Look for ST_Transform().

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.