[gdal-dev] enable GEOS support (GDAL/OGR 1.7.1; GEOS 2.3.0; VB.NET)

toefftoeff1 at gmx.net toefftoeff1 at gmx.net
Fri Mar 5 11:26:42 EST 2010


I would like to build and use OGR with GEOS support on Windows XP 32 bit
Visual Basic.NET (.NET framework 2.0 or 3.5).

GDAL/OGR 1.7.1 and GEOS 2.3.0 compilation seem to work fine (using
nmake, Visual Studio 2008, only
warnings, no error messages).

I used the following GDAL/OGR nmake.opt settings to include GEOMS support:

# Uncomment for GEOS support
GEOS_CFLAGS = -I$(GEOS_DIR)/capi -I$(GEOS_DIR)/source/headers -DHAVE_GEOS
GEOS_LIB     = $(GEOS_DIR)/build/msvc90/Release/geos_c_i.lib

But using GEOMS in a sample .NET project always results in an exception
"GEOS support not enabled".

Sample code:


            Dim g1 As Geometry = Geometry.CreateFromWkt("POLYGON((0 0,
10 10, 10 0, 0 0))")
            Dim g2 As Geometry = Geometry.CreateFromWkt("POLYGON((-90
-90, -90 90, 190 -90, -90 -90))")

            Dim result As Boolean = g2.Contains(g1)

I copied all GDAL/OGR wrapper libraries and geos_c.dll to the
appropriate places.

Any suggestions?

Thanks a lot...


More information about the gdal-dev mailing list