1

I am trying to overlay CodePoint with Polygons onto leaflet JS. My current problem is converting the .shp file into the correct projection and a kml.

If I open the shp file (using qgis) with the projection of "OSGB 1636" which (from what I understand is the correct projection), when I "Save as" and select the new projection of "WSG84". This is the result:

  <Placemark>
    <Style><LineStyle><color>ff0000ff</color></LineStyle><PolyStyle><fill>0</fill></PolyStyle></Style>
  <MultiGeometry><Polygon><outerBoundaryIs><LinearRing><coordinates>inf,inf inf,inf inf,inf inf,inf inf,inf inf,inf inf,inf inf,inf inf,inf inf,inf inf,inf inf,inf inf,inf inf,inf inf,inf</coordinates></LinearRing></outerBoundaryIs></Polygon><Polygon><outerBoundaryIs><LinearRing><coordinates>inf,inf inf,inf inf,inf inf,inf inf,inf inf,inf inf,inf inf,inf inf,inf inf,inf inf,inf inf,inf inf,inf inf,inf inf,inf inf,inf</coordinates></LinearRing></outerBoundaryIs></Polygon></MultiGeometry>

Using ogr2ogr command:

ogr2ogr -t_srs 'EPSG:4326' -s_srs 'EPSG:4277' -f 'KML' 84.kml SO.shp

I get this output:

Failed to reproject feature 0 (geometry probably out of source or destination SRS).
ERROR 1: Terminating translation prematurely after failed
translation of layer SO (use -skipfailures to skip errors)

Is there anything I'm doing incorrectly - to get this data to the correct projection?

  • 3
    try epsg:27700 for OSGB – Ian Turton Mar 18 '14 at 13:37
  • iant - This worked, could you answer the question and I'll give you the credit – Mark Willis Mar 19 '14 at 9:31
3

I'm not sure where you found the code epsg:4277 from but it is a representation of the OS national grid in degrees (if I'm reading the EPSG file correctly) the much more common EPSG code is EPSG:27700 which is measured in meters.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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