OGR bug?
Ivano Picco
ivano.picco at AQUPI.TK
Tue Nov 9 07:57:02 PST 2004
Hi!,
Some week ago I posted some questions about SVG generation from Oracle
Spatial data using OGR, but I didn't get usefull answer, maybe because my
questions were wrong (Creating SVG from Shapefile, Oracle Spatial, ArcSDE -
6 Oct 2004).
I made some other test, also using perl mapscript, to bypass some bug in
mapserv code. There's my results:
Both using mapserv or my simple perl script the OGR driver for Oracle
Spatial took about 2Gbytes of memory to getFeature from a layer with 4800
geometries (the shapefile is 2,6 Mbyte). Both the performance is worst than
arcsde connection or shapefile access (6s shape, 21s SDE): about 10
minutes running perl script !!!
I think there's a bug in OGR implementation where it's used to get features
or shapes (with perl mapscript getFeature, or query layer with mapserv).
Please, could you confirm this bug?
Other questions: why I can't use getFeature method with OracleSpatial
connection type? Why I can't draw map from SDE or OGR layer?
There's any plan to support all methods on all connection types?
There's some workaround to get features from OracleSpatial connection?, and
one to define a query layer?
Thanks a lot for your support,
sorry for my english,
Ivano Picco
this is my perl mapscript:
#!/usr/bin/perl
use mapscript;
$map_file='prova.map';
die mapscript::ms_error->{message} unless my $map = new
mapscript::mapObj($map_file);
print $map->{numlayers}." layers found.\n";
die mapscript::ms_error->{message} unless my $layer =
$map->getLayerByName('isolati_10k_SDO_OGR');
print "Loading Layer ".$layer->{index}."\n";
$layer->open();
my $i=0;
my $shape= $layer->getFeature($i);
while ( $shape->{bounds}->{minx}>0 ){
print "Shape $i has ". $shape->{numlines} ." part(s) - ";
printf "bounds (%f,%f) (%f,%f)\n",
$shape->{bounds}->{minx},$shape->{bounds}->{miny}, $shape->{bounds}->{maxx},
$shape->{bounds}->{maxy};
for($j=0; $j<$shape->{numlines}; $j++) {
my $part = $shape->get($j);
print "Part $j has ". $part->{numpoints} ." point(s)\n";
for($k=0; $k<$part->{numpoints}; $k++) {
my $point = $part->get($k);
#print "$k: ". $point->{x} .", ". $point->{y} ."\n";
}
}
$i++;
$shape= $layer->getFeature($i);
}
this is my prova.map:
NAME DEMO
STATUS ON
SIZE 600 600
EXTENT 313263.000000 4879724.000000 517049.000000 5145994.000000
UNITS METERS
DEBUG ON
WEB
log "/tmp/CTR_map.log"
IMAGEPATH '/home/mapserver/public_html/tmp/'
IMAGEURL 'http://gisspeas2.csi.it:18091/tmp/'
TEMPLATE 'template.html'
METADATA
WMS_TITLE "UMN MapServer Itasca Demo"
WMS_ABSTRACT "This is the UMN MapServer demonstration application for
Itasca County located in north central Minnesota."
WMS_ACCESSCONSTRAINTS none
# change this value to match your setup
WMS_ONLINERESOURCE
"http://localhost.localdomain/mapserver_demos/itasca/demo_init.html"
WMS_SRS "EPSG:32632"
END
HEADER 'header.svg'
FOOTER 'footer.svg'
QUERYFORMAT 'image/svg+xml'
END
LAYER
NAME isolati_10k
TYPE POLYGON
DATA /home/mapserver/dati/CTR/shape/edificati/EDIFICATI
CLASS
OUTLINECOLOR 0 0 255
#COLOR 255 255 255
SIZE 4
END
METADATA
WMS_TITLE "County Boundary"
WMS_ABSTRACT "Example og County Boundary"
WMS_SRS "EPSG:32632"
END
END
LAYER
NAME isolati_10k_SDO
TYPE POLYGON
CONNECTION "XX/XX at GEO"
CONNECTIONTYPE oraclespatial
DATA "GEOMETRY FROM edificati" STATUS ON
CLASS
OUTLINECOLOR 0 0 255
#COLOR 255 255 255
SIZE 4
END
METADATA
WMS_TITLE "County Boundary"
WMS_ABSTRACT "Example og County Boundary"
WMS_SRS "EPSG:32632"
END
END
LAYER
NAME isolati_10k_SDE
# MAXSCALE 40000
TYPE POLYGON
CONNECTION "gisspedb1.csi.it,port:5151,esri_sde,ctr_sde,ctr_sde"
CONNECTIONTYPE SDE
DATA "ctr_sde.edificati,SHAPE"
CLASS
OUTLINECOLOR 0 0 255
#COLOR 255 255 255
SIZE 4
END
METADATA
WMS_TITLE "Isolati SDE"
WMS_ABSTRACT "Example og County Boundary"
WMS_SRS "EPSG:32632"
END
END
LAYER
NAME isolati_10k_SDO_OGR
# MAXSCALE 20000
TYPE POLYGON
CONNECTION "OCI:XX/XX at GEO"
CONNECTIONTYPE OGR
DATA "SELECT GEOMETRY FROM edificati"
#WHERE SDO_FILTER( edificati.GEOMETRY, MDSYS.SDO_GEOMETRY(2003, NULL,
NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,3),MDSYS.SDO_ORDINATE_ARRAY(313263,4879724,517049,5145994)
),'querytype=window') = 'TRUE'"
CLASS # every other county in the state
#OUTLINECOLOR 0 0 225
COLOR 231 159 32
SIZE 4
END
METADATA
WMS_TITLE "Fabbricati SDO"
WMS_ABSTRACT "Example og County Boundary"
WMS_SRS "EPSG:32632"
END
END
END # Map File
More information about the MapServer-users
mailing list