Map Problems

Hi Roger,

Copying this to the user list, since others are likely to encounter
the need for reprojection. I will update the docs also.

There may be something wrong with my shapefile to GeoJSON conversion.
The polygon vertices are looking like 254808.379, 1999087.952 while lat/lon
of an interior point is 9.82,-2.68. Does ogr use the .prj file or do I have
to pass params on the command line?

Your .prj file has the following content:

PROJCS["Accra_Ghana_Grid",GEOGCS["GCS_Accra",DATUM["D_Accra",SPHEROID["War_Office",6378300,296]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943299]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",900007.2200889268],PARAMETER["False_Northing",0],PARAMETER["Central_Meridian",-1],PARAMETER["Scale_Factor",0.99975],PARAMETER["Latitude_Of_Origin",4.666666666666667],UNIT["Foot_Clarke",0.30479726499999998]]

Pasting this tool http://prj2epsg.org/search yields a lot of
possibilities, but I would think EPSG 2136 - Accra / Ghana National
Grid would be right.

To convert this to lat/lon, you have to pass reprojection parameters
on the command line like this:
ogr2ogr s_srs EPSG:2236 a_srs EPSG:4326 -f GML filename.gml filename.shp

Alternatively, you could use the excellent open source Quantum GIS
tool (http://www.qgis.org), which has now incorporated ogr in the
latest version (1.5).

Knut

···

On Wed, Nov 17, 2010 at 10:38 AM, Friedman, Roger (CDC/CGH/DGHA) (CTR) > <rdf4@cdc.gov> wrote:

In fact, you could probably also use the .prj file directly, like this
(I think):

ogr2ogr s_srs projectionfile.prj a_srs EPSG:4326 -f GML filename.gml
filename.shp

http://help.nceas.ucsb.edu/GDAL

Knut

···

On Wed, Nov 17, 2010 at 11:21 AM, Knut Staring <knutst@gmail.com> wrote:

On Wed, Nov 17, 2010 at 10:38 AM, Friedman, Roger (CDC/CGH/DGHA) (CTR) >> <rdf4@cdc.gov> wrote:

There may be something wrong with my shapefile to GeoJSON conversion.
The polygon vertices are looking like 254808.379, 1999087.952 while lat/lon
of an interior point is 9.82,-2.68. Does ogr use the .prj file or do I have
to pass params on the command line?

Your .prj file has the following content:

PROJCS["Accra_Ghana_Grid",GEOGCS["GCS_Accra",DATUM["D_Accra",SPHEROID["War_Office",6378300,296]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943299]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",900007.2200889268],PARAMETER["False_Northing",0],PARAMETER["Central_Meridian",-1],PARAMETER["Scale_Factor",0.99975],PARAMETER["Latitude_Of_Origin",4.666666666666667],UNIT["Foot_Clarke",0.30479726499999998]]

Pasting this tool http://prj2epsg.org/search yields a lot of
possibilities, but I would think EPSG 2136 - Accra / Ghana National
Grid would be right.

To convert this to lat/lon, you have to pass reprojection parameters
on the command line like this:
ogr2ogr s_srs EPSG:2236 a_srs EPSG:4326 -f GML filename.gml filename.shp

Alternatively, you could use the excellent open source Quantum GIS
tool (http://www.qgis.org), which has now incorporated ogr in the
latest version (1.5).

Knut

--
Cheers,
Knut Staring