0

I am trying to extract OSM land use information for a given bounding box in PostGIS. Using this example I wrote my code:

SELECT *
FROM planet_osm_polygon 
WHERE 
  planet_osm_polygon.landuse && 
  ST_Transform(ST_MakeEnvelope(1.49464, 49.1963130, 1.628030, 49.287031, 4326), 32647);

Unfortunately it returns me an error:

ERROR: transform: couldn't project point (1.49464 49.1963 0): latitude or longitude exceeded limits (-14)

Ivan T
  • 111
  • 4
  • Are you sure your coordinates are stored in EPSG:32647? If you used osm2pgsql, they will be in EPSG:3857. Apart from that, EPSG:32647 does not cover 1.5E 49.2N – AndreJ Mar 11 '17 at 20:24

1 Answers1

1

The problem was in a wrong column I should take planet_osm_polygon.way not planet_osm_polygon.landuse

SELECT  * FROM planet_osm_polygon 
WHERE planet_osm_polygon.way && 
ST_Transform(ST_MakeEnvelope( 2.3160604029813427 ,49.20365292898691, 2.317437943284213 ,49.204552967527086 , 4326), 900913)
Ivan T
  • 111
  • 4
  • Out of interest, does osm have comprehensive land use information? – John Powell Mar 13 '17 at 08:49
  • What do you mean by 'comprehensive'? If you are refering to completeness it depends on the region of the map and provided by annotaters detalization. – Ivan T Mar 13 '17 at 16:15
  • OK, that's good enough. That fails my definition of comprehensive, which is more or less based on online dictionary:"including or dealing with all or nearly all elements or aspects of something. ". Back to satellite image processing it is :-) – John Powell Mar 13 '17 at 17:01