New answers tagged

1

WKT is only a text markup language for representing vector geometry, therefore you cannot convert 3D WKT to 2D (= text to text), you need to change the geometry The problem with ogr is that it seems that all the geometries are 3D by defaut 1) Creation of a 2D point with ogr point = ogr.Geometry(ogr.wkbPoint) # 2D point point.AddPoint(1198054.34, 648493.09)...


1

I had to face the same errors when trying to import PostGIS geometries into R. I could manage to iterate readWKT() through the polygons with the help of the apply-function-family: All credits to: https://spacetimecereal.com/2015/01/13/loading-postgis-geometries-into-r-without-rgdal-an-approach-without-loops/ Connect to PostgreSQL DB: drv <- dbDriver("...


0

Microsoft's implementation of the spatial types and functions standard is a bit quirky -- The ST functions don't have an underscore between the ST and the function name (e.g. STWithin vice ST_Within) Rather than taking two operands, the operators are a function of the Geometry/Geography datatype (e.g., pnt.geom.STWithin(ply.geom) vice ST_Within(pnt.geom,...


0

You probably want to do this: select ST_Intersection( ST_Transform( ST_SetSRID(ST_GeomFromText('POLYGON(( 200000 2900000,250000 3500000,300000 2960000,200000 2967400,200000 2900000))'),96703),4326), ST_Transform(geom, 4326)) from polygon_folder; But, I am quite sure (from Finding all polygons inside of a polygon) that ST_Intersection ...


1

You are missing ST_AsText, as @WKT mentions above. This should work for you: select ST_AsText(geom) from polygon where ST_Intersects(ST_GeographyFromText ('POLYGON((210000 2400000, 300000 2300000, 330000 3708400, 210000 2400000))'), polygon.geom);



Top 50 recent answers are included