MapServer / MapServer-import

3 stars 2 forks source link

MapServer/GEOS integration #770

Open tbonfort opened 12 years ago

tbonfort commented 12 years ago

Reporter: sdlime Date: 2004/07/13 - 21:24

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
tbonfort commented 12 years ago

Author: sgillies@frii.com Date: 2004/09/03 - 18:04

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.
tbonfort commented 12 years ago

Author: sdlime Date: 2004/09/10 - 22:00

Your loss I guess... ;-) It'll be awhile before I can get back to that code 
seriously though...
tbonfort commented 12 years ago

Author: sdlime Date: 2005/02/22 - 08:55

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
tbonfort commented 12 years ago

Author: sgillies@frii.com Date: 2005/02/24 - 18:58

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.
tbonfort commented 12 years ago

Author: sdlime Date: 2005/02/24 - 19:30

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
tbonfort commented 12 years ago

Author: dmorissette Date: 2005/04/21 - 15:53

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.
tbonfort commented 12 years ago

Author: sdlime Date: 2007/07/25 - 16:27 This is long complete...

Steve