<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
tt
        {mso-style-priority:99;
        font-family:"Courier New";}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Verdana","sans-serif";
        color:#003399;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
 /* List Definitions */
 @list l0
        {mso-list-id:360014099;
        mso-list-template-ids:-705164952;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:1.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:"Courier New";
        mso-bidi-font-family:"Times New Roman";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:1.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:2.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana","sans-serif";
color:#003399'>Doug,<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana","sans-serif";
color:#003399'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana","sans-serif";
color:#003399'>Thanks for these suggestions. It looks like PostGIS and
SpatialLite both provide a SQL-based approach for accomplishing what I need.
Both look promising and I will dig into them in more detail.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana","sans-serif";
color:#003399'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana","sans-serif";
color:#003399'>It might be less than optimal to load data into one of these,
execute the desired spatial query, and export data back out. But there is
probably no suitable alternative that provides a complete set of spatial
operators that is any faster. I'm sure a big part of executing efficient
spatial queries is having a spatial index. Even OGR does not appear to expose spatial
indexes that may be maintained by the underlying data sources. Thus any
geoprocessing library that sits on OGR or a similar API must already retrieve
all records, build a spatial index, then execute the spatial query. This is
basically the same thing as loading data into PostGIS or SpatialLite and then executing
the query.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana","sans-serif";
color:#003399'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana","sans-serif";
color:#003399'>I have tons of questions but will resist asking all but one: do
you know how well these systems can be embedded in other software? In my collection
of tools, I want the infrastructure that supports them to be hidden and config-less.
Although I have not used SQLite, I know it is designed explicitly for easy
embedding, so it seems promising. What about Postgres? In my past experience,
it appeared to be much more of a full-blown enterprise database system,
designed to run as a service or daemon, listen for connections, etc. If it can
be easily embedded, I might prefer to use it, as PostGIS appears to provide a
richer set of spatial operators.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana","sans-serif";
color:#003399'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana","sans-serif";
color:#003399'>Jason<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana","sans-serif";
color:#003399'><o:p>&nbsp;</o:p></span></p>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
Doug_Newcomb@fws.gov [mailto:Doug_Newcomb@fws.gov] <br>
<b>Sent:</b> Tuesday, January 12, 2010 12:29 PM<br>
<b>To:</b> Jason Roberts<br>
<b>Cc:</b> 'gdal-dev'; gdal-dev-bounces@lists.osgeo.org<br>
<b>Subject:</b> Re: [gdal-dev] Open source vector geoprocessing libraries?<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p style='margin-bottom:12.0pt'>Jason,<br>
If you're working with vector data, why not throw the data into
Postgresql/Postgis, <a href="http://postgis.refractions.net">http://postgis.refractions.net</a>,
and use the spatial operators there to select/buffer/intersect the vector
geometries as you describe. <a
href="http://postgis.refractions.net/documentation/manual-1.4/ch07.html">http://postgis.refractions.net/documentation/manual-1.4/ch07.html</a>
for geoprocessing operations. Your application can pass SQL commands to the
database. You can use ogr to load data /export your finished product to/from
postgresql/postgis . <br>
<br>
You might be able to similar things in spatialite, <a
href="http://www.gaia-gis.it/spatialite/spatialite-tutorial-2.3.1.html#t4">http://www.gaia-gis.it/spatialite/spatialite-tutorial-2.3.1.html#t4</a>.<br>
<br>
Doug<br>
<br>
Doug Newcomb <br>
USFWS<br>
Raleigh, NC<br>
919-856-4520 ext. 14 doug_newcomb@fws.gov<br>
---------------------------------------------------------------------------------------------------------<br>
The opinions I express are my own and are not representative of the official
policy of the U.S.Fish and Wildlife Service or Dept. of the Interior. Life is
too short for undocumented, proprietary data formats.<br>
<img border=0 width=16 height=16 id="_x0000_i1025"
src="cid:image001.gif@01CA93A9.9B2CA1B0"
alt="Inactive hide details for &quot;Jason Roberts&quot; &lt;jason.roberts@duke.edu&gt;">&quot;Jason
Roberts&quot; &lt;jason.roberts@duke.edu&gt;<br>
<br>
<o:p></o:p></p>

<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width="100%"
 style='width:100.0%'>
 <tr>
  <td width="40%" valign=top style='width:40.0%;padding:0in 0in 0in 0in'>
  <p class=MsoNormal style='margin-left:2.0in'><b><span style='font-size:10.0pt'>&quot;Jason
  Roberts&quot; &lt;jason.roberts@duke.edu&gt;</span></b><span
  style='font-size:10.0pt'> </span><br>
  <span style='font-size:10.0pt'>Sent by: gdal-dev-bounces@lists.osgeo.org</span>
  <o:p></o:p></p>
  <p style='margin-left:2.0in'><span style='font-size:10.0pt'>01/11/2010 05:32
  PM</span><o:p></o:p></p>
  </td>
  <td width="60%" valign=top style='width:60.0%;padding:0in 0in 0in 0in'>
  <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width="100%"
   style='width:100.0%'>
   <tr>
    <td width="1%" valign=top style='width:1.0%;padding:0in 0in 0in 0in'>
    <p class=MsoNormal><img border=0 width=58 height=1 id="_x0000_i1026"
    src="cid:image003.png@01CA93A9.9B2CA1B0"><o:p></o:p></p>
    <p class=MsoNormal align=right style='text-align:right'><span
    style='font-size:10.0pt'>To</span><o:p></o:p></p>
    </td>
    <td width="100%" valign=top style='width:100.0%;padding:0in 0in 0in 0in'>
    <p class=MsoNormal><img border=0 width=1 height=1 id="_x0000_i1027"
    src="cid:image004.png@01CA93A9.9B2CA1B0"><br>
    <span style='font-size:10.0pt'>&quot;'gdal-dev'&quot;
    &lt;gdal-dev@lists.osgeo.org&gt;</span><o:p></o:p></p>
    </td>
   </tr>
   <tr>
    <td width="1%" valign=top style='width:1.0%;padding:0in 0in 0in 0in'>
    <p class=MsoNormal><img border=0 width=58 height=1 id="_x0000_i1028"
    src="cid:image003.png@01CA93A9.9B2CA1B0"><o:p></o:p></p>
    <p class=MsoNormal align=right style='text-align:right'><span
    style='font-size:10.0pt'>cc</span><o:p></o:p></p>
    </td>
    <td width="100%" valign=top style='width:100.0%;padding:0in 0in 0in 0in'>
    <p class=MsoNormal><img border=0 width=1 height=1 id="_x0000_i1029"
    src="cid:image004.png@01CA93A9.9B2CA1B0"><o:p></o:p></p>
    </td>
   </tr>
   <tr>
    <td width="1%" valign=top style='width:1.0%;padding:0in 0in 0in 0in'>
    <p class=MsoNormal><img border=0 width=58 height=1 id="_x0000_i1030"
    src="cid:image003.png@01CA93A9.9B2CA1B0"><o:p></o:p></p>
    <p class=MsoNormal align=right style='text-align:right'><span
    style='font-size:10.0pt'>Subject</span><o:p></o:p></p>
    </td>
    <td width="100%" valign=top style='width:100.0%;padding:0in 0in 0in 0in'>
    <p class=MsoNormal><img border=0 width=1 height=1 id="_x0000_i1031"
    src="cid:image004.png@01CA93A9.9B2CA1B0"><br>
    <span style='font-size:10.0pt'>[gdal-dev] Open source vector geoprocessing
    libraries?</span><o:p></o:p></p>
    </td>
   </tr>
  </table>
  <p class=MsoNormal><span style='display:none'><o:p>&nbsp;</o:p></span></p>
  <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0>
   <tr>
    <td width=58 valign=top style='width:43.5pt;padding:0in 0in 0in 0in'>
    <p class=MsoNormal><img border=0 width=1 height=1 id="_x0000_i1032"
    src="cid:image004.png@01CA93A9.9B2CA1B0"><o:p></o:p></p>
    </td>
    <td width=336 valign=top style='width:3.5in;padding:0in 0in 0in 0in'>
    <p class=MsoNormal><img border=0 width=1 height=1 id="_x0000_i1033"
    src="cid:image004.png@01CA93A9.9B2CA1B0"><o:p></o:p></p>
    </td>
   </tr>
  </table>
  </td>
 </tr>
</table>

<p><br>
<span style='font-family:"Calibri","sans-serif"'>Dear geospatial software
experts,</span><br>
<br>
<span style='font-family:"Calibri","sans-serif"'>By integrating with GEOS, OGR
can perform various spatial operations on individual geometries, such as
buffer, intersection, union, and so on. Is there a library that efficiently
performs these kinds of operations on entire OGRLayers? For example, this
library would have functions that would buffer all of the features in a layer,
or intersect all of the features in one layer with all of those in another.
Basically, I am looking for an open source technology that replicates the
&quot;geoprocessing tools&quot; found in ArcGIS and other GIS packages. These
tools traditionally operate on one or more layers as input and produce one or
more layers as output.</span><br>
<br>
<span style='font-family:"Calibri","sans-serif"'>If such a library does not
exist, does the OGR team envision that they might add such capabilities to OGR
in the future? From software design and performance points of view, would it be
appropriate to extend OGR to include functions for spatial operations on entire
layers, or is this best left to other libraries? I can see rudimentary ways to
implement such tools (e.g. for intersecting layers: loop over all features in
both layers, calling OGRGeometry::Touches on all combinations, or something
similar). But I am not a geometry expert and do not know if OGRLayer's
cursor-based design is compatible with such capabilities; I do not know about
spatial indexing, for example.</span><br>
<br>
<span style='font-family:"Calibri","sans-serif"'>I develop open source
geoprocessing tools that help with spatial ecology problems. At the moment, my
tools depend on heavily on ArcGIS for these operations with vector layers. I
would like to remove this dependency, and, if possible, develop a toolbox that
exposes the same ecology tools to several GIS packages. Many GIS packages, such
as ArcGIS, QGIS, MapWindow, and OpenJump, support plugin extensions. I am
wondering whether how difficult it would be to develop a package of tools that
does not depend on a specific GIS package but exposes them to several packages
via the package-specific plugin mechanisms. For this to work, I'd have to find
a library that can do the kind of geoprocessing with layers that ArcGIS can do,
or write my own. Writing it myself sounds daunting and am hoping that there are
existing projects to draw from.</span><br>
<br>
<span style='font-family:"Calibri","sans-serif"'>Thank you very much for any
comments you can provide.</span><br>
<br>
<span style='font-family:"Calibri","sans-serif"'>Jason</span><br>
<br>
<br>
<tt><span style='font-size:10.0pt'>_______________________________________________</span></tt><span
style='font-size:10.0pt;font-family:"Courier New"'><br>
<tt>gdal-dev mailing list</tt><br>
<tt>gdal-dev@lists.osgeo.org</tt><br>
<tt><a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a></tt></span><o:p></o:p></p>

</div>

</body>

</html>