[mapserver-users] maporaclespatial

Joel Schlagel joel at crrel.usace.army.mil
Wed Nov 14 17:02:45 EST 2001


i haven't seen anyone mention it yet, so i'll try to be the first happy
mapserver user to thank Rodrigo Cabral for all his work on the
maporaclespatial code.  we've been using it for about a week and its
worked perfectly.

we used oracle shp2sdo utility to convert shape files to oracle
loader format.  we loaded 2.7 million texas tiger 2000 road segments as a
test data set, indexed with oracle's recommended tile size, and have been
viewing and querying with mapserver with no problem.

the nicest part of using oracle spatial with mapserver is being able to
pass standard sql queries either from the map file or by modifiying
the map_layer_data_ .. these can be attribute queries, oracle
spatial queries on geometry, or a combination.  i included a couple of
lines from a map file in case anyone's interested ...

# counties from oracle spatial

LAYER
  NAME counties
  TYPE polygon
  STATUS default
  MAXSCALE 1000000
  CONNECTIONTYPE oraclespatial
  CONNECTION 'u/p at sdo'
  DATA "GEOM from tx_cty"
  CLASS
    NAME 'county'
    COLOR 220 224 230
    OUTLINECOLOR 0 0 0
  END

# only draw interstates (hwi) from all roads

LAYER
  NAME tx1
  TYPE line
  STATUS default
  MAXSCALE 200000
  MINSCALE 80000
  CONNECTIONTYPE oraclespatial
  CONNECTION 'u/p at sdo'
  DATA "GEOM from (select * from tx_rds where CFCC = 'hwi')
  CLASS"
    COLOR 200 0 0
  END

END


#  draw 1/2 degree x 1/2 degree square area from roads

LAYER
  NAME tx2
  TYPE line
  STATUS default
  CONNECTIONTYPE oraclespatial
  CONNECTION 'u/p at sdo'
  DATA "GEOM from (select * from tx_rds where mdsys.sdo_relate
    (tx_rds.geom, mdsys.sdo_geometry (2003, null, null,mdsys.sdo_elem_info_array
    (1,1003,3), mdsys.sdo_ordinate_array  (-100, 30.5, -99.5 , 31)),
    'mask=ANYINTERACT querytype=WINDOW') = 'TRUE')"
  CLASS
    COLOR 200 0 0
  END
END



joel






More information about the mapserver-users mailing list