1

I downloaded the HIFLD Railroads DB and imported it into MySQL with OSGeo4W. I then do this query and the coordinates I get just don't make sense:

SELECT ST_AsGeoJson(SHAPE)
FROM railroads
WHERE OGR_FID = 123751;

Here's what I get back:

{
   "type":"LineString",
   "coordinates":[
      [
         -10791447.5365,
         3527298.6227
      ],
...
   ]
}

That's not a GPS coordinate. idk what that is.

When I use OSGeo4W with another DB (TIGER County DB) I get coordinates that do make sense. The query I use with that:

SELECT ST_AsGeoJson(SHAPE)
FROM county_shapes
WHERE OGR_FID = 1637;

The result:

{
   "type":"Polygon",
   "coordinates":[
      [
         [
            -97.997996,
            30.720209
         ],
...
      ]
   ]
}

Those coordinates make sense so using OSGeo4W can work but it just isn't for the HIFLD Railroads DB.

Any ideas?

1
  • 4
    The railroads dataset is projected in Web Mercator (EPSG:3857). The coordinates that you see are Web Mercator X,Y coordinates in meters. You could transform the data into EPSG:4326 in order to get WGS84 degrees. – FSimardGIS Nov 27 '20 at 0:21

Your Answer

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

Browse other questions tagged or ask your own question.