Antwort: [UMN_MAPSERVER-USERS] Display Lines as Points

Benedikt Rothe umn-ms at HYDROTEC.DE
Thu Mar 15 00:35:08 PDT 2007


Hi

Maybe you could use an PL/SQL-Function, which converts the lines into 
multipoints. 

create or replace function Line2Point(aLine mdsys.sdo_geometry) return 
mdsys.sdo_geometry is
  dims integer;
begin
  if (aLine is null) then 
     return null;
  end if;
  if (aLine.SDO_ELEM_INFO is null or aLine.SDO_ORDINATES is null) then
     return null;
  end if; 
  dims := aLine.SDO_GTYPE / 1000;

  return MDSYS.SDO_GEOMETRY(
                        dims*1000+5, -- SDO_GTYPE: MULTIPOINT,
                        aLine.SDO_SRID,
                        NULL,        -- No Singe-Point 
                    -- SDO_STARTING_OFFSET,SDO_ETYPE: Point type 
,SDO_INTERPRETATION: Point cluster with n points.                        
                        MDSYS.SDO_ELEM_INFO_ARRAY(1,2,aLine.SDO_ORDINATES.
Count / dims), 
                        aLine.SDO_ORDINATES);  -- Ticks don't change
end Line2Point;
/

create or replace view XStream as Select Line2Point(shape) shape, 
name,nummer from Streams;

Than use XStream in the Layer of the Mapserver-Map-File.

Maybe you must dig a little bit in the SDO-Documentation to find correct 
settings for ELEM_INFO_ARRAY. 
Should be something like this.

Benedikt Rothe



UMN MapServer Users List <MAPSERVER-USERS at LISTS.UMN.EDU> schrieb am 
14.03.2007 16:17:48:

> Hi Folks!
> 
> We have a rather tricky problem and maybe someone out there knows a
> solution.
> We have a layer of  rivers, divided in 500m Segments, stored in an
> Oracle Spatial DB.
> Each segment is a simple line with a starting point and an end point,
> but they shall not be displayed a slines, but rather as points.
> What we want is simnply to represent every segment by its starting point
> only.
> Is that possible?
> 
> Walter
> 
> LFRZ
> A-1200 Wien, Dresdner Strasse 89
> Tel:   ++43(1)33 176/421
> Fax:   ++43(1)33 176/999
> Email: walter.pleyer at lfrz.at
> WWW:   http://www.lfrz.at 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20070315/8217a752/attachment.htm>


More information about the MapServer-users mailing list