[postgis-users] Mixing LINESTRING and MULTILINESTRING data

Ben Madin ben at remoteinformation.com.au
Wed Jan 7 12:39:37 PST 2009


G'day Simon,

Thanks for you help,

On 08/01/2009, at 5:01 AM, postgis-users- 
request at postgis.refractions.net wrote:

> Grab the definition of this CHECK constraint by clicking on the  
> table in pgAdminIII. Then do this:
>
> ALTER TABLE gis_roads DROP CONSTRAINT enforce_geotype_the_geom;
> ALTER TABLE gis_roads ADD CONTRAINT enforce_geotype_geom CHECK  
> (geometrytype(the_geom) IN  
> ('LINESTRING'::text,'MULTILINESTRING'::text) OR gethe_geomom IS NULL);
>
> It will now allow linestrings and multilinestrings to be inserted  
> into the table.


Great - I had some sense the the storage of a geometry type was  
slightly more primitive than that.


>> 3. Is there any reason I wouldn't want to mix the two data types...
>> are linestrings more efficiently handled etc.
>
> I'm not an expert on the specifics of PostGIS but if the object is a  
> linestring then store and index it as a linestring and remove the  
> additional handling required to extract the linestring from the  
> multilinestring for processing and rendering. Has to be a little bit  
> faster.


OK - thanks again - it is only a small table by the standards of some  
(90000 rows)

cheers

Ben


-- 

Ben Madin
REMOTE INFORMATION

t : +61 8 9192 5455
f : +61 8 9192 5535
m : 0448 887 220
Broome   WA   6725

ben at remoteinformation.com.au



							Out here, it pays to know...





More information about the postgis-users mailing list