[Gdal-dev] GDAL Capabilities
Chapman, Martin
MChapman at sanz.com
Wed Jan 21 12:04:19 EST 2004
Patrick,
You can also write your own IsPointInPolygon() and IsLineInPolygon() functions very easily. I can send you the code if you like, but you will still need a lib to open the vector files to get a hold of the shape geometry. Also, you could link to the OpenGL library and use the gluPickMatrix() function to determine intersection of polygons. You need to know how to use OpenGL but it's spatial query functions (collision detection) are very powerful because it can do 3D intersection as well as 2D. Just a thought.
Martin
-----Original Message-----
From: Tyler Mitchell [mailto:TMitchell at lignum.com]
Sent: Wed 1/21/2004 9:48 AM
To: gdal-dev at remotesensing.org
Cc:
Subject: Re: [Gdal-dev] GDAL Capabilities
> program to generate a dynamic polygon based on lat/lon points input
> by the user
> and determine which polygons on a shapefile (us counties) fall within or
> intersect this dynamic polygon. A simple check to see if the county
> polygons in
> the shapefile fall within or intersect the dynamic polygon.
Patrick,
I'll take a kick at an answer, then others can correct me or fill in the
gaps.
I would say a general "yes" to your question and would highly recommend
GDAL library for the task. If there are holes in the functionality for
your specific task, there are bound to be other options (i.e. using the
PostGIS spatial database would allow you to do everything you want, all
using SQL within a database. You should consider that as well. See
http://postgis.refractions.net).
You can program with GDAL (or more specifically, OGR, the vector subset of
the GDAL libraries) to create new datasources and create features
programmatically. I could envision how I would do this, receiving a list
of vertices/points in sequential order from the user. Then building a
polygon feature with these. You could then open the county polygons file
too.
The only part I'm not sure of is GDAL/OGR's abilities to do geometric
comparisons between features. I bet it's there somewhere but I haven't
touched it yet.
Also note that I work primarily in Python which has hooks into the c++
library. Being an ArcInfo guy myself, I've found Python to be as intuitive
as AML and much more fun than VB :)
For what it's worth,
Tyler
_______________________________________________
Gdal-dev mailing list
Gdal-dev at remotesensing.org
http://remotesensing.org/mailman/listinfo/gdal-dev
More information about the Gdal-dev
mailing list