Opened 20 years ago

Closed 17 years ago

#770 closed enhancement (fixed)

MapServer/GEOS integration

Reported by: sdlime Owned by: sdlime
Priority: high Milestone: 4.6 release
Component: MapServer C Library Version: unspecified
Severity: minor Keywords:
Cc: sgillies@…

Description (last modified by sdlime)

A tracker for integrating MapServer and GEOS. To date I've got skeletal code in 
place, and the build environment all configured. Nothing has been checked in 
yet...

Steve

Attachments (1)

test.gif (1.5 KB ) - added by sdlime 19 years ago.
The 1st GEOS/MapServer image…

Download all attachments as: .zip

Change History (12)

comment:1 by sgillies@…, 20 years ago

Steve,

There is no support for building GEOS on windows except for VC .NET and
cygwin.  I am using VC 6, and won't be able to build or test.  I think
there are a lot of other people without VC .NET, including Frank.

comment:2 by sdlime, 20 years ago

Status: newassigned
Your loss I guess... ;-) It'll be awhile before I can get back to that code 
seriously though...

comment:3 by sdlime, 19 years ago

Made large strides with this today. I have most simple conversions working
although I do need to work on collections (multi-point/line/polygon) and
MapServer polygons to GEOS in general. MapServer is very (too?) flexible so
polygons will be tricky. However, I've tested with simple points and line
strings and it works nicely. At this point the only exposed method is for
buffering via MapScript. So you can do stuff like:

$point = new mapscript::pointObj();
$line = new mapscript::lineObj();
$shape = new mapscript::shapeObj($mapscript::MS_SHAPE_LINE);

$point->{x} = 50;
$point->{y} = 50;
$line->add($point);
$point->{x} = 100;
$point->{y} = 90;
$line->add($point);
$point->{x} = 90;
$point->{y} = 150;
$line->add($point);
$point->{x} = 30;
$point->{y} = 180;
$line->add($point);
$point->{x} = 150;
$point->{y} = 220;
$line->add($point);
$shape->add($line);

$map = new mapscript::mapObj('buffer.map') or die 'could not load map';

$buffered_shape = $shape->buffer(20) or die 'buffer failed';
$layer = $map->getLayerByName('buffer') or die 'could not get layer';
$layer->{status} = $mapscript::MS_ON;
$layer->addFeature($buffered_shape);

$layer = $map->getLayerByName('nobuffer') or die 'could not get layer';
$layer->{status} = $mapscript::MS_ON;
$layer->addFeature($shape);

$image = $map->draw();
$image->save('test.gif');

Pretty slick. Could query, save or whatever now with that new shape. Ton's of
possibilities...

Steve

by sdlime, 19 years ago

Attachment: test.gif added

The 1st GEOS/MapServer image...

comment:4 by sgillies@…, 19 years ago

Steve, we need to think about what it means to be adding GEOS-only methods
into mapscript.  Howard's windows builds are failing.

I've tried hard to keep mapserver macros (like USE_GEOS) out of the SWIG 
interface files because of the extra complexity that adds to mapscript
compilation.  It's better to keep all that isolated in libmap.  I think that you
should be making stubs for the functions in mapgoes.cpp that raise errors when
GEOS support isn't available.  Like the various OWS and SLD functions do.

comment:5 by sdlime, 19 years ago

They do raise errors as with other modules, check for yourself. The 
msGEOSBuffer and msGEOSConvexHull functions are there and valid regardless of 
the presence of GEOS support. There must be something else going on...

Steve

comment:6 by dmorissette, 19 years ago

Cc: dmorissette@… added

comment:7 by dmorissette, 19 years ago

Milestone: 4.6 release

comment:8 by dmorissette, 19 years ago

blocked: 1327

comment:9 by dmorissette, 19 years ago

Steve, I created bug 1327 about adding the new mapscript methods to PHP
MapScript. When you add new GEOS methods, can you please list them in that bug.

comment:10 by unicoletti, 18 years ago

Cc: unicoletti@… added

comment:11 by sdlime, 17 years ago

Description: modified (diff)
Resolution: fixed
Status: assignedclosed

This is long complete...

Steve

Note: See TracTickets for help on using tickets.