[GRASS-SVN] r36513 - grass/trunk/vector/v.select
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Mar 29 10:22:05 EDT 2009
Author: martinl
Date: 2009-03-29 10:22:05 -0400 (Sun, 29 Mar 2009)
New Revision: 36513
Modified:
grass/trunk/vector/v.select/main.c
grass/trunk/vector/v.select/proto.h
Log:
compile v.select without GEOS
Modified: grass/trunk/vector/v.select/main.c
===================================================================
--- grass/trunk/vector/v.select/main.c 2009-03-29 13:53:03 UTC (rev 36512)
+++ grass/trunk/vector/v.select/main.c 2009-03-29 14:22:05 UTC (rev 36513)
@@ -209,6 +209,8 @@
#ifdef HAVE_GEOS
initGEOS(G_message, G_fatal_error);
GEOSGeometry *AGeom = NULL;
+#else
+ void *AGeom = NULL;
#endif
/* Alloc space for input lines array */
@@ -242,7 +244,9 @@
if (flag.geos && flag.geos->answer) {
if (!(ltype & (GV_POINT | GV_LINE)))
continue;
+#ifdef HAVE_GEOS
AGeom = Vect_line_to_geos(&(In[0]), APoints, ltype);
+#endif
if (!AGeom)
G_fatal_error(_("Unable to read line id %d from vector map <%s>"),
aline, Vect_get_full_name(&(In[0])));
@@ -269,11 +273,14 @@
}
if (flag.geos && flag.geos->answer) {
+#ifdef HAVE_GEOS
if(line_relate_geos(&(In[1]), AGeom,
bline, operator, parm.relate->answer)) {
+
found = 1;
break;
}
+#endif
}
else {
Vect_read_line(&(In[1]), BPoints, NULL, bline);
@@ -308,11 +315,13 @@
}
if (flag.geos && flag.geos->answer) {
+#ifdef HAVE_GEOS
if(area_relate_geos(&(In[1]), AGeom,
barea, operator, parm.relate->answer)) {
ALines[aline] = 1;
break;
}
+#endif
}
else {
if (line_overlap_area(&(In[0]), aline, &(In[1]), barea)) {
@@ -323,7 +332,9 @@
}
}
if (flag.geos && flag.geos->answer) {
+#ifdef HAVE_GEOS
GEOSGeom_destroy(AGeom);
+#endif
AGeom = NULL;
}
}
@@ -338,7 +349,6 @@
naareas = Vect_get_num_areas(&(In[0]));
for (aarea = 1; aarea <= naareas; aarea++) {
- int i;
BOUND_BOX abox;
G_percent(aarea, naareas, 2); /* must be before any continue */
@@ -352,8 +362,10 @@
abox.T = PORT_DOUBLE_MAX;
abox.B = -PORT_DOUBLE_MAX;
- if (flag.geos && flag.geos->answer) {
+ if (flag.geos && flag.geos->answer) {
+#ifdef HAVE_GEOS
AGeom = Vect_read_area_geos(&(In[0]), aarea);
+#endif
if (!AGeom)
G_fatal_error(_("Unable to read area id %d from vector map <%s>"),
aline, Vect_get_full_name(&(In[0])));
@@ -374,11 +386,13 @@
}
if (flag.geos && flag.geos->answer) {
+#ifdef HAVE_GEOS
if(line_relate_geos(&(In[1]), AGeom,
bline, operator, parm.relate->answer)) {
add_aarea(&(In[0]), aarea, ALines);
break;
}
+#endif
}
else {
if (line_overlap_area(&(In[1]), bline, &(In[0]), aarea)) {
@@ -441,11 +455,13 @@
Vect_read_line(&(In[1]), BPoints, NULL, bcentroid);
if (flag.geos && flag.geos->answer) {
+#ifdef HAVE_GEOS
if(area_relate_geos(&(In[1]), AGeom,
barea, operator, parm.relate->answer)) {
found = 1;
break;
}
+#endif
}
else {
if (Vect_point_in_area(&(In[0]), aarea,
@@ -469,7 +485,9 @@
}
}
if (flag.geos && flag.geos->answer) {
+#ifdef HAVE_GEOS
GEOSGeom_destroy(AGeom);
+#endif
AGeom = NULL;
}
}
Modified: grass/trunk/vector/v.select/proto.h
===================================================================
--- grass/trunk/vector/v.select/proto.h 2009-03-29 13:53:03 UTC (rev 36512)
+++ grass/trunk/vector/v.select/proto.h 2009-03-29 14:22:05 UTC (rev 36513)
@@ -8,11 +8,13 @@
#define OP_OVERLAPS 7
#define OP_RELATE 8
+#ifdef HAVE_GEOS
/* geos.c */
int line_relate_geos(const struct Map_info *, const GEOSGeometry *,
int, int, const char *);
int area_relate_geos(const struct Map_info *, const GEOSGeometry *,
int, int, const char *);
+#endif
/* overlap.c */
void add_aarea(struct Map_info *, int, int *);
More information about the grass-commit
mailing list