[Mapserver-users] Mulitiline string to Polygon

nida Khan nida at webstar.co.uk
Thu Jan 2 02:41:18 PST 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> </DIV>
<DIV><FONT size=3D2>I have three table created from .NTF(boundary =
line) 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> </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> </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> </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> </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?  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> </DIV>
<DIV><FONT size=3D2>Best Regards</FONT></DIV>
<DIV><FONT size=3D2>Nida.</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>PS:my table structrue is like =
this.</FONT></DIV><FONT size=3D2>
<DIV><BR>test=3D# \d bl200_llnik</DIV>
<DIV>   Column   =
|      =20
Type        | Modifiers=20
<BR>------------+-------------------+-----------<BR> gid  =
     =20
| integer           |=20
<BR> line_id    |=20
integer           |=20
<BR> geom_id    |=20
integer           |=20
<BR> feat_code  | character varying | <BR> global_lin |=20
integer           |=20
<BR> tile_ref   | character varying |=20
<BR> the_geom   |=20
geometry          | =
<BR>Check=20
constraints: "$1" (srid(the_geom) =3D=20
-1)<BR>           =
       =20
"$2" ((geometrytype(the_geom) =3D 'MULTILINESTRING'::text) OR (the_geom =
IS=20
NULL))</DIV>
<DIV> </DIV>
<DIV>test=3D# \d=20
bl2000_poly <BR>        &nbs=
p;           &nbsp=
;   </DIV>
<DIV>     Column     =20
|      =20
Type       =20
|            =
            &=
nbsp;=20
Modifiers          &nbs=
p;           &nbsp=
;  =20
<BR>-----------------+-------------------+-------------------------------=
------------------------------<BR> ogc_fid    &n=
bsp;   =20
| integer           | =
not null=20
default=20
nextval('"bl2000_poly_ogc_fid_seq"'::text)<BR> wkb_geometry &nb=
sp; =20
| geometry          |=20
<BR> poly_id         |=20
numeric(6,0)      | =
<BR> global_seed_id  |=20
numeric(6,0)      |=20
<BR> hectares        |=20
numeric(12,3)     |=20
<BR> num_parts       |=20
numeric(4,0)      |=20
<BR> dir          =
  =20
| character varying | <BR> geom_id_of_link | character varying |=20
<BR> ringstart       | character =
varying |=20
<BR> tile_ref        |=20
character(10)     | <BR>Unique keys:=20
bl2000_poly_ogc_fid_key<BR>Check constraints: "$1" (srid(wkb_geometry) =
=3D=20
104306)</DIV>
<DIV> </DIV>
<DIV>test=3D# \d bl2000_collection <BR>   </DIV>
<DIV>     Column     =20
|      =20
Type       =20
|            =
            &=
nbsp;   =20
Modifiers          &nbs=
p;           &nbsp=
;     =20
<BR>-----------------+-------------------+-------------------------------=
------------------------------------<BR> ogc_fid   &n=
bsp;    =20
| integer           | =
not null=20
default=20
nextval('"bl2000_collection_ogc_fid_seq"'::text)<BR> wkb_geometry&nb=
sp;  =20
| geometry          |=20
<BR> coll_id         |=20
numeric(6,0)      |=20
<BR> num_parts       |=20
numeric(4,0)      |=20
<BR> poly_id         | =
character=20
varying | <BR> admin_area_id   |=20
numeric(6,0)     =20
| <BR> admin_name      | character =
varying |=20
<BR> area_type       |=20
character(2)      |=20
<BR> area_code       |=20
character(3)      | =
<BR> non_type_code  =20
| character(3)      | <BR> non_inland_area =
|=20
numeric(12,3)     | =
<BR> coll_id_refs   =20
| character varying |=20
<BR> tile_ref        |=20
character(10)     | <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