May 25th, Geocamp 2013, Óbidos
On harbours we have draughtsmen,
surveyors, civil engineers
...but harbours want to use GIS to manage
...so they usually implement GIS at some level
and our loved draughtsman have
to load THEIR
data into the GIS
SELECT
index_name
FROM
SYS.user_indexes
WHERE
index_name LIKE 'myTable_IDX';
if(the_geom !== null){
type = the_geom.getGeometryType();
}
if(the_geom !== null){
factory = the_geom.getFactory();
coords = the_geom.getCoordinates();
}
try{
if ( coords[0].equals(coords[coords.length - 1])) {
isValid = true;
lineRing = factory.createLinearRing(coords);
the_geomPol = factory.createPolygon(lineRing,null);
area = the_geomPol.getArea();
}
else {
isValid = false;
the_geomPol = null;
area = 0;
}
} catch(err){
isValid = false;
the_geomPol = null;
area = 0;
}
Set the correct SRS
UPDATE myTable a
SET a.geometry.sdo_srid=83030
WHERE a.geometry IS NOT NULL;
Fix invalid geometries
UPDATE myTable a
SET geometry =
SDO_UTIL.RECTIFY_GEOMETRY(geometry, 0.00001)
WHERE
SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(
a.geometry,0.00001) <> 'TRUE'
AND a.geometry is not null
AND a.geometry.SDO_GTYPE is not null
AND SDO_GEOM.VALIDATE_GEOMETRY(a.geometry,0.00001)
IN ('13367','13356','13349');
Create a new index
CREATE INDEX myTable_IDX ON
myTable(geometry)
INDEXTYPE IS
MDSYS.SPATIAL_INDEX PARAMETERS('sdo_indx_dims=2');
Draughtsman, Genoa accident at The Telegraph , stylish gifs from topito
This content is under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 unported license.