[Mapserver-users] Mulitiline string to Polygon

nida Khan nida at webstar.co.uk
Thu Jan 2 05:41:18 EST 2003


This is a multi-part message in MIME format.

------=_NextPart_000_012F_01C2B24B.7B9440C0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi list,

I have three table created from .NTF(boundary line) file provided by =
Ordinance Survery. using ogr2ogr.
One with geometry data, other two with features information. namely, =
BL2000_LINK,BL2000_POLY,BL2000_COLLECTION

I can create the map perfectly fine, main problem comes, when I want to =
display a label from those feature table.

As its a MultilineString geom, label comes on top of line, instead of =
middle of "formed polygon", which makes sense...

Is there anyway of controling the inside area of two lines???
I thought If I can create a polygon geometry instead of multilineString =
it can make my task easy!

Is there any way of doing it???
Has anyone ever worked on Boundary line data from Ordinance Survey =
before?  If yes, how do you cope with these problems?
How do you inforce relational integrity b/w three tables?

Best Regards
Nida.

PS:my table structrue is like this.

test=3D# \d bl200_llnik
   Column   |       Type        | Modifiers=20
------------+-------------------+-----------
 gid        | integer           |=20
 line_id    | integer           |=20
 geom_id    | integer           |=20
 feat_code  | character varying |=20
 global_lin | integer           |=20
 tile_ref   | character varying |=20
 the_geom   | geometry          |=20
Check constraints: "$1" (srid(the_geom) =3D -1)
                   "$2" ((geometrytype(the_geom) =3D =
'MULTILINESTRING'::text) OR (the_geom IS NULL))

test=3D# \d bl2000_poly=20
                       =20
     Column      |       Type        |                          =
Modifiers                         =20
-----------------+-------------------+-----------------------------------=
--------------------------
 ogc_fid         | integer           | not null default =
nextval('"bl2000_poly_ogc_fid_seq"'::text)
 wkb_geometry    | geometry          |=20
 poly_id         | numeric(6,0)      |=20
 global_seed_id  | numeric(6,0)      |=20
 hectares        | numeric(12,3)     |=20
 num_parts       | numeric(4,0)      |=20
 dir             | character varying |=20
 geom_id_of_link | character varying |=20
 ringstart       | character varying |=20
 tile_ref        | character(10)     |=20
Unique keys: bl2000_poly_ogc_fid_key
Check constraints: "$1" (srid(wkb_geometry) =3D 104306)

test=3D# \d bl2000_collection=20
  =20
     Column      |       Type        |                             =
Modifiers                            =20
-----------------+-------------------+-----------------------------------=
--------------------------------
 ogc_fid         | integer           | not null default =
nextval('"bl2000_collection_ogc_fid_seq"'::text)
 wkb_geometry    | geometry          |=20
 coll_id         | numeric(6,0)      |=20
 num_parts       | numeric(4,0)      |=20
 poly_id         | character varying |=20
 admin_area_id   | numeric(6,0)      |=20
 admin_name      | character varying |=20
 area_type       | character(2)      |=20
 area_code       | character(3)      |=20
 non_type_code   | character(3)      |=20
 non_inland_area | numeric(12,3)     |=20
 coll_id_refs    | character varying |=20
 tile_ref        | character(10)     |=20
Unique keys: bl2000_collection_ogc_fid_key
Check constraints: "$1" (srid(wkb_geometry) =3D 104306)

------=_NextPart_000_012F_01C2B24B.7B9440C0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>Hi list,</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>I have three table created from .NTF(boundary =
line)&nbsp;file=20
provided by Ordinance Survery. using ogr2ogr.</FONT></DIV>
<DIV><FONT size=3D2>One with geometry data, other two with features =
information.=20
namely, BL2000_LINK,BL2000_POLY,BL2000_COLLECTION</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>I can create the map perfectly fine, main problem =
comes, when=20
I want to display a label from those feature table.</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>As its a MultilineString geom, label comes on top of =
line,=20
instead of middle of "formed polygon", which makes sense...</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>Is there anyway of controling the inside area of two =

lines???</FONT></DIV>
<DIV><FONT size=3D2>I thought If I can create a polygon geometry instead =
of=20
multilineString it can make my task easy!</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>Is there any way of doing it???</FONT></DIV>
<DIV><FONT size=3D2>Has anyone ever worked on Boundary line data from =
Ordinance=20
Survey before?&nbsp; If yes, how do you cope with these =
problems?</FONT></DIV>
<DIV><FONT size=3D2>How do you inforce relational integrity b/w three=20
tables?</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>Best Regards</FONT></DIV>
<DIV><FONT size=3D2>Nida.</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>PS:my table structrue is like =
this.</FONT></DIV><FONT size=3D2>
<DIV><BR>test=3D# \d&nbsp;bl200_llnik</DIV>
<DIV>&nbsp;&nbsp; Column&nbsp;&nbsp; =
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
Type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Modifiers=20
<BR>------------+-------------------+-----------<BR>&nbsp;gid&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
| integer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |=20
<BR>&nbsp;line_id&nbsp;&nbsp;&nbsp; |=20
integer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |=20
<BR>&nbsp;geom_id&nbsp;&nbsp;&nbsp; |=20
integer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |=20
<BR>&nbsp;feat_code&nbsp; | character varying | <BR>&nbsp;global_lin |=20
integer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |=20
<BR>&nbsp;tile_ref&nbsp;&nbsp; | character varying |=20
<BR>&nbsp;the_geom&nbsp;&nbsp; |=20
geometry&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | =
<BR>Check=20
constraints: "$1" (srid(the_geom) =3D=20
-1)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
"$2" ((geometrytype(the_geom) =3D 'MULTILINESTRING'::text) OR (the_geom =
IS=20
NULL))</DIV>
<DIV>&nbsp;</DIV>
<DIV>test=3D# \d=20
bl2000_poly&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp; Column&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
Type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;=20
Modifiers&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;=20
<BR>-----------------+-------------------+-------------------------------=
------------------------------<BR>&nbsp;ogc_fid&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;=20
| integer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | =
not null=20
default=20
nextval('"bl2000_poly_ogc_fid_seq"'::text)<BR>&nbsp;wkb_geometry&nbsp;&nb=
sp;&nbsp;=20
| geometry&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |=20
<BR>&nbsp;poly_id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |=20
numeric(6,0)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | =
<BR>&nbsp;global_seed_id&nbsp; |=20
numeric(6,0)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |=20
<BR>&nbsp;hectares&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |=20
numeric(12,3)&nbsp;&nbsp;&nbsp;&nbsp; |=20
<BR>&nbsp;num_parts&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |=20
numeric(4,0)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |=20
<BR>&nbsp;dir&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;=20
| character varying | <BR>&nbsp;geom_id_of_link | character varying |=20
<BR>&nbsp;ringstart&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | character =
varying |=20
<BR>&nbsp;tile_ref&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |=20
character(10)&nbsp;&nbsp;&nbsp;&nbsp; | <BR>Unique keys:=20
bl2000_poly_ogc_fid_key<BR>Check constraints: "$1" (srid(wkb_geometry) =
=3D=20
104306)</DIV>
<DIV>&nbsp;</DIV>
<DIV>test=3D# \d bl2000_collection&nbsp;<BR>&nbsp;&nbsp;&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp; Column&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
Type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;=20
Modifiers&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
<BR>-----------------+-------------------+-------------------------------=
------------------------------------<BR>&nbsp;ogc_fid&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
| integer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | =
not null=20
default=20
nextval('"bl2000_collection_ogc_fid_seq"'::text)<BR>&nbsp;wkb_geometry&nb=
sp;&nbsp;&nbsp;=20
| geometry&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |=20
<BR>&nbsp;coll_id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |=20
numeric(6,0)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |=20
<BR>&nbsp;num_parts&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |=20
numeric(4,0)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |=20
<BR>&nbsp;poly_id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | =
character=20
varying | <BR>&nbsp;admin_area_id&nbsp;&nbsp; |=20
numeric(6,0)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
|&nbsp;<BR>&nbsp;admin_name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | character =
varying |=20
<BR>&nbsp;area_type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |=20
character(2)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |=20
<BR>&nbsp;area_code&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |=20
character(3)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | =
<BR>&nbsp;non_type_code&nbsp;&nbsp;=20
| character(3)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | <BR>&nbsp;non_inland_area =
|=20
numeric(12,3)&nbsp;&nbsp;&nbsp;&nbsp; | =
<BR>&nbsp;coll_id_refs&nbsp;&nbsp;&nbsp;=20
| character varying |=20
<BR>&nbsp;tile_ref&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |=20
character(10)&nbsp;&nbsp;&nbsp;&nbsp; | <BR>Unique keys:=20
bl2000_collection_ogc_fid_key<BR>Check constraints: "$1" =
(srid(wkb_geometry) =3D=20
104306)</FONT></DIV></BODY></HTML>

------=_NextPart_000_012F_01C2B24B.7B9440C0--




More information about the mapserver-users mailing list