[gdal-dev] ogr2ogr from postGIS to shapefile not clipping

Pere Roca Ristol peroc79 at gmail.com
Fri Aug 24 07:47:14 PDT 2018


Oh, yes, sorry... I forgot to do the intersection on the geom field! below
works perfectly, thanks!

 select ST_Intersection(TABLE1.geom, 
 ST_GeomFromText('POLYGON((31.7 -13.1, 31.6 
  -13.04,31.96 -13.04,31.9 -13.1,31.7 
  -13.1))',4326) ) as geom,

  a_code as code,ST_Area(ST_Transform(ST_Intersection(TABLE1.geom, 
  ST_GeomFromText('POLYGON((31.7 -13.1, 31.6 
  -13.04,31.96 -13.04,31.9 -13.1,31.7 
  -13.1))',4326) ),32736))*0.0001::double precision as area from TABLE1 
 where 

 ST_Intersection(TABLE1.geom, 
  ST_GeomFromText('POLYGON((31.7 -13.1, 31.6 
  -13.04,31.96 -13.04,31.9 -13.1,31.7 
  -13.1))',4326) )



--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html


More information about the gdal-dev mailing list