I think that if you built GDAL with GEOS support, you can call on the GEOS methods from directly within your ogr objects. (Not sure I'm saying that right) There is an example here - <a href="http://mapserver.gis.umn.edu/community/conferences/MUM3/workshop/python/geometriespdf">
http://mapserver.gis.umn.edu/community/conferences/MUM3/workshop/python/geometriespdf</a><br><br>Code in the example looks something like this:<br><br>#! /usr/bin/python<br><br>import ogr<br><br>r1 = {'minx': -5.0
, 'miny': 0.0, 'maxx': 5.0, 'maxy':10.0}<br>r2 = {'minx': 0.0, 'miny': -5.0, 'maxx': 10.0, 'maxy':5.0}<br><br>template = 'POLYGON ((%(minx)f %(miny)f, %(minx)f %(maxy)f, %(maxx)f %(maxy) f, %(maxx)f %(miny)f, %(minx)f %(miny)f))'
<br><br>w1 = template % r1<br>w2 = template % r2<br><br>g1 = ogr.CreateGeometryFromWkt(w1)<br>g2 = ogr.CreateGeometryFromWkt(w2)<br><br>inter = g1.Intersection(g2) # <---------------GEOS Intersection command?<br><br>
print inter<br><br>--<br><br><div class="gmail_quote">On Jan 22, 2008 11:31 AM, Brian Hamlin <<a href="mailto:maplabs@light42.com">maplabs@light42.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
thats a good application of PostGIS<br>I think people can do it with GEOS directly, but I have not written<br>that myself<br><font color="#888888"><br> -Brian<br></font><div><div></div><div class="Wj3C7c"><br><br>On Jan 22, 2008, at 10:40 AM,
<a href="mailto:estrada.adam@gmail.com">estrada.adam@gmail.com</a> wrote:<br><br>> All,<br>> I have quite a bit of LIDAR data that has been converted to point<br>> shapefiles. I need to select all the points that intersect with
<br>> another polygon shapefile and then write those features to another<br>> layer (shapefile). ArcGIS will definitely do it but I am afraid that<br>> my machine is not beefy enough to handle LIDAR-sized datasets so I was
<br>> wondering if anyone knew of some functionality in OGR lib that would<br>> do this for me? I cannot seem to figure out how to select by location<br>> with the set of tools that are available i.e ogr2ogr...<br>
><br>> Many thanks in advance,<br>> AWE<br>> _______________________________________________<br>> gdal-dev mailing list<br>> <a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br><br>_______________________________________________<br>gdal-dev mailing list<br><a href="mailto:gdal-dev@lists.osgeo.org">
gdal-dev@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br></div></div></blockquote></div><br>