[Featureserver] LineString instead of MultiLineString

Alexandre Dube adube at mapgears.com
Tue Dec 9 15:41:08 EST 2008


Hi list,

  I see in PostGis.py at line 117 that when a feature geometry type is 
MultiLineString, it returns LineString instead.  Is there a reason for 
this ?  Why doesn't it return MultiLineString ?


  Want to know more ?  Read what's following :

  I want to try an other way to insert/update/delete vector features in 
OpenLayers.  So far, I've tried TinyOWS with a PostGIS database ( in 
fact, the data came from a shapefile I converted to postGIS with 
shp2pgsql, and the shapefile was in LineString but because I omitted the 
-S parameter it became MultiLineString in PostGIS).

   So, the geometry of my table is in MultiLineString and I have the 
following constrain that prevents me from updating any type of geometry 
but MultiLineString :
    "enforce_geotype_the_geom" CHECK (geometrytype(the_geom) = 
'MULTILINESTRING'::text OR the_geom IS NULL)

  To resolve my problem, I could do one of the following :
  - Drop the constrain or add an OR 'LineString'...
  - delete my whole data and do a shp2pgsql with -S to have LineString 
instead

  But, I really wonder why featureserver don't return the correct type 
of geometry.  So before doing anything, I wanted to have some comments 
about this, please.

  Also, what is the difference between MultiLineString and LineString.  
Any docs to point ?

  Oh, and BTW I use GeoJSON format in OpenLayers and I can see * 
@requires OpenLayers/Geometry/MultiLineString.js, so I suppose it 
supports MultiLineString, correct ?

Many thanks in advance,

Alexandre

-- 
Alexandre Dubé
Mapgears
www.mapgears.com




More information about the Featureserver mailing list