Documentation of Geometry validity in Oracle Spatial?

Is there anywhere in the 10g Spatial documentation where the geometric conditions required for a geometry to be valid are defined? I've found a few sentences spread through the document, but I would have expected that such an important concept would have had a single place where it was summarized.

As the designer of JTS, I'm intimately familiar with the OGC SFS spec!
Of course it's always nice to see statements about adherence to specs. But it's even nicer to see vendor documentation that explicitly states the semantics of the data model, to confirm the adherence to the spec. Actually most of that information is in the Spatial docs, I think - it's just spread out and a bit hard to find.
Also, the OGC SFS does leave some room for implementations to vary. For instance, the SFS does not mandate the orientation of rings in polygons, whereas Oracle requires a specific orientation. This kind of thing is very important for developers to be aware of.
Anyway, my primary concern was about whether valid LineStrings can self-intersect, and I think that's answered now.

Similar Messages

  • Oracle spatial 11g - 3D-Geometry and KML-Export

    Hi,
    I'm currently working with an Oracle Spatial 11g - database and there with 2d- and 3d-geometries. With this Version you can extrude 2d's to 3d's and calculate their volumes. This works fine.
    The problem is to save the extruded areas as 3d-geometries in a specific table. Enclosed you will find the SQL-Code of the current workflow:
    *1. Create tables for the 2d- and 3d-geometries (incl. metadata and spatial index)*
    -- table for 3d-geometry
    CREATE
    TABLE ta_geb(
    geom MDSYS.SDO_GEOMETRY
    ,area NUMBER(12,3)
    -- metadata 2D
    INSERT INTO USER_SDO_GEOM_METADATA (TABLE_NAME, COLUMN_NAME, DIMINFO, SRID)
    VALUES
         'ta_geb',
         'geom',
    MDSYS.SDO_DIM_ARRAY
    (MDSYS.SDO_DIM_ELEMENT('X',4439900.00, 4440020.00, 0.005),
    MDSYS.SDO_DIM_ELEMENT('Y', 5664050.00, 5664130.00, 0.005)
    31468
    -- spatial index 2D
    CREATE
    INDEX ta_geb_index ON ta_geb(geom) INDEXTYPE IS MDSYS.SPATIAL_INDEX;
    -- table for 3d-geometry
    CREATE
    TABLE ta_3dgeb(
    geom3d MDSYS.SDO_GEOMETRY
    -- metadata 3D
    INSERT INTO USER_SDO_GEOM_METADATA (TABLE_NAME, COLUMN_NAME, DIMINFO, SRID)
    VALUES
         'ta_3dgeb',
         'geom3d',
    MDSYS.SDO_DIM_ARRAY
    (     MDSYS.SDO_DIM_ELEMENT('X',4439900.00, 4440020.00, 0.005),
         MDSYS.SDO_DIM_ELEMENT('Y', 5664050.00, 5664130.00, 0.005),
         MDSYS.SDO_DIM_ELEMENT('Z', 0, 200, 0.005)
    31468
    -- spatial index
    CREATE
    INDEX ta_3dgeb_index ON ta_3dgeb(geom3d) INDEXTYPE IS MDSYS.SPATIAL_INDEX PARAMETERS ('SDO_INDX_DIMS=3');
    *2. insert 2d-geomtry*
    INSERT
    INTO
    ta_geb
    VALUES
    MDSYS.SDO_GEOMETRY(
    2003
    ,31468
    ,NULL
    ,MDSYS.SDO_ELEM_INFO_ARRAY(
    1
    ,1003
    ,1
    ,MDSYS.SDO_ORDINATE_ARRAY(
         4439975.91,5664077.07,
              4439967.98,5664072.06,
              4439975.33,5664060.42,
              4439983.26,5664065.43,
              4439975.91,5664077.07
    ,null --area
    *3. calculate volume of the extruded area*
    SELECT SDO_GEOM.SDO_VOLUME(SDO_UTIL.EXTRUDE(
         GEOM,
         SDO_NUMBER_ARRAY(0),
         SDO_NUMBER_ARRAY(10),
         'false', --validation
         0.005),0.005)
    from ta_geb;
    This works fine so far. Now I wanna insert the extruded geometry (now 3D) in the table ta_3dgeb. All my attempts were in vain...
    *4. insert extruded geomtry*
    INSERT
    INTO
    ta_3dgeb
    select
    SDO_UTIL.EXTRUDE(
              GEOM,
              SDO_NUMBER_ARRAY(0),
              SDO_NUMBER_ARRAY(10),
              'false', --validation
              0.005)
    from ta_geb;
    I got the following error message after executing this Code:
    ORA-29875: failed in the execution of the ODCIINDEXINSERT routine
    ORA-13365: layer SRID does not match geometry SRID
    ORA-06512: in "MDSYS.SDO_INDEX_METHOD_10I", line 709
    ORA-06512: in "MDSYS.SDO_INDEX_METHOD_10I", line 225
    Then I tried to change something on the metadata and spatial indices, wihtout success. Does anyone has advices to solve the problem??
    Afterwards I would like to export the 3d-geometry in a KML file to visualize it in Google Earth. Therefore oracle provides a tool. But I didn't managed it to export the geometry. Any hints for the KML export or are there any other tools alternatively??
    Thanks for any suggestions!
    Regards

    Extrude does not automatically populate the SRID for the resulting geometry as there may not be a 3D equivalent of the 2D SRID defined
    in the DB.
    So the extruded geometry comes out without the SRID. In your case, since you are creating an index on the ta_3dgeb table
    before inserting the extruded data, it is causing this failure.
    So drop the index on the ta_3dgeb table and do the inserts into it.
    Then you can manually update the geometries with the SRID if there is a corresponding 3D SRID for 31468.
    Otherwise, you can use 31468.
    siva

  • Is there a function in Oracle Spatial 11g to move/translate geometry?

    Hello Everybody,
         I am new to Oracle Spatial. I wanted to know if there is any function to move/translate a geometry in Oracle Spatial 11g? PostGIS has a function named ST_Translate to achieve the same.
    Regards,
    Shiva Shankar

    Hi
    There is an SDO_UTIL.AFFINETRANSFORMS function in the  SDO_UTIL Package (Utility)
    Note, that Simon Greener & Siva Ravada have published an excellent book ("Applying and Extending Oracle Spatial") that contains examples (in Chapter 7) of easy to use wrappers for this:
    http://www.packtpub.com/applying-and-extending-oracle-spatial/book
    Luc

  • Java.lang.ClassNotFoundException: oracle.spatial.geometry.JGeometry

    I have installed UIM 7.2.2 on Oracle Linux 5.6_64 bit. There was no error message during the installation. But we are getting java.lang.ClassNotFoundException: oracle.spatial.geometry.JGeometry exception during runtime, specially while opening UIM home page in the browser.
    Any suggestion?
    Thanks,
    Molay

    Hi,
    Please let me know the iPlanet service pack number that you are using.
    Thanks
    Ganesh .R
    Developer Technical Support
    Sun Microsystems
    http://www.sun.com/developers/support

  • Oracle Spatial Training Documentation

    I have to give some Oracle Spatial formation and i need some material to build this course.
    Where could i find this kind of document?
    ....thanks for your help

    Thanks for the advice but i already did that kind of research. I found some documentation but nothing from Oracle.
    Im working for a company that is a "Certified Advantage Partner" (OPN PIN: 147582435711). Can i have acces to some Training Documentation on Oracle Spatial or to some Oracle spatial training from Oracle University?
    Im sure that Oracle has some PPT files on Oracle Spatial.
    .....thanks for your help

  • Oracle Spatial - inserts/updates to geometry tables

    I am getting the following errors when inserting into an SDO_GEOMETRY object type:
    java.sql.SQLException: ORA-29877: failed in the execution of the ODCIINDEXUPDATE routine
    ORA-13000: dimension number is out of range
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD", line 8
    ORA-06512: at "MDSYS.SDO_IDX", line 86
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD", line 83
    ORA-06512: at line 1
    I have looked in the Oracle Spatial User Guide for 8i and have not been able to find much on the information above.
    Any help from inviduals with more expertise in this area would be great. If I need to provide more information please do indicate this as well
    Thanks,
    Faroon.

    Hi,
    The number of dimensions in the object being inserted may be
    out of the valid range ( 2 to 4).
    Or the diminfo in the user_sdo_geom_metadata for this
    layer has been changed the after the index is created.
    Check these two places first to make sure the dimensionality
    is in the valid range.
    The error is raised on index updated when the dimensionality
    of the object being updated is not in the valid range.
    siva

  • Where is the documentation for Oracle Spatial Relational Model?

    Hi,
    I'm working with Oracle Spatial for my schema model. In the documentation "Oracle Spatial User's Guide and Reference" there is a note about what this is in OTN but i don't find it!!
    Can anybody help me, where I find the "Oracle Spatial Relational Model Guide and Reference"?

    Thanks! But just i have read this information. And in the documentation for spatial 9.0.1 there is one document only, and in this document there is a Note that reference to nonexistent document with title "Oracle Spatial Relational Model Guide and Reference" this is the document that i'm searching.
    Thank you for your help!

  • Package oracle.spatial.geometry

    hi guys,
    do you know how to install the Oracle Spatial Java Class Library?
    i'm using Jdeveloper 10g.
    thank you

    Hi Angelo,
    Assuming that you have the jar files, you could add the spatial library to your project properties by right clicking the mouse on the project node, going to Project Properties, Libraries (under Profiles, Development), and then creating a new library name pointing to the spatial library files (jar files).

  • Extended WKT notation in Oracle Spatial

    Hi,
    I have a AutoCAD spatial filter condition as follows,
    GEOM ENVELOPEINTERSECTS GeomFromText('POLYGON XYZ ((-60 45 0, 40 15 0, 30 15 0, -60 48 0, -60 33 0))').
    When I try to get the geometry in Oracle Spatial as below,
    Select SDO_UTIL.from_WKTGEOMETRY('POLYGON XYZ ((-60 45 0, 40 15 0, 30 15 0, -60 48 0, -60 33 0))') from dual;
    I am getting an error as "[Error] Execution (2: 8): ORA-29532: Java call terminated by uncaught Java exception: java.sql.SQLException: oracle.spatial.util.GeometryExceptionWithContext: java.lang.RuntimeException: Opening parentheses missing -3
         at oracle.spatial.util.WKT$WKTInputStream.readStartList(WKT.java:223)
         at oracle.spatial.util.WKBasis.readStartList(WKBasis.java:1542)
         at oracle.spatial.util.WKBasis.toJGeometry_WKB_POLYGON(WKBasis.java)
         at oracle.spatial.util.WKBasis.toJGeometry(WKBasis.java:1077)
         at oracle.spatial.util.WKBasis.toJGeometry(WKBasis.java:1033)
         at oracle.spatial.util.WKBasis.toSTRUCT(WKBasis.java:148)
         at oracle.spatial.util.Adapters.wktToSTRUCT2(Adapters.java:208)
         at oracle.spatial.util.Adapters.wktToSTRUCT(Adapters.java:198)
         at oracle.spatial.util.Adapters.wktToSTRUCT(Adapters.java:188)
    ORA-06512: at "MDSYS.SDO_UTIL", line 187"
    Validating the geometry gives null,
    SQL> Select SDO_UTIL.validate_WKTGEOMETRY('POLYGON XYZ ((-60 45 0, 40 15 0, 30 15 0, -60 48 0, -60 3
    3 0))') from dual;
    SDO_UTIL.VALIDATE_WKTGEOMETRY('POLYGONXYZ((-60450,40150,30150,-60480,-60330))')
    null null
    What am I doing wrong here? Also what is the equivalent sdo_util funtion for ENVELOPEINTERSECTS?
    Thanks.
    Ananda

    Hi folks,
    We talked in the past that a lot of this confusion could be mitigated if the Oracle documentation just stated clearly what version of the OGC specification the WKT functions support. Been a bit of talk on the forum recently on various OGC support issues and it strikes me as being kind of unproductive since nothing has changed in terms of OGC support since... I guess since the GML 3.1.1 functions were released with 11gR1. Is that correct? And before that? So the situation could be termed as being "very stable". :)
    Oracle Spatial WKT functionality (as of 11.2.0.3) pretty simply only supports the Simple Features 1.1 specification. End of story. Be nice if it said so here:
    http://docs.oracle.com/cd/E11882_01/appdev.112/e11830/sdo_util.htm#SPATL1234
    I'll try this weekend to submit an enhancement request for that as I don't think anyone else has.
    Meanwhile most of us either use Simon's JTS solution or long ago coded our own readers/writers in PLSQL.
    I've been trying to think of ways we could somehow inspire more forum users to submit SRs on the issues they bring up here. I am as lazy as the next person on the matter. Maybe some kind of point rewards for putting in SRs? I am not looking for folks to just knee-jerk submit SRs to every posting, but clearly there are some communities of interest (GML users for example) that could document their collective concerns through metalink.
    Cheers,
    Paul

  • SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT for polygon geometry validation

    Hi,
    I would like to make a validation of the polygon geometry upon a table SCHEMA.TABLE with the GEOM field, where the geometry is stored.
    Can someone help me with a sample SQL sentence to fill my SCHEMA.VALIDITY table with all the detected errors that occured in the SCHEMA.TABLE?
    Thanks!
    Dejan

    Greg
    Have you tried scrolling down to the bottom of that section? You will see the following example (as in all descriptions in the documentation):
    Examples*
    The following example validates the geometry objects stored in the SHAPE column of the COLA_MARKETS table. The example includes the creation of the result table. For this example, a deliberately invalid geometry was inserted into the table before the validation was performed.
    -- Is a layer valid? (First, create the result table.)
    CREATE TABLE val_results (sdo_rowid ROWID, result varchar2(1000));
    -- (Next statement must be on one command line.)
    CALL SDO_GEOM.VALIDATE_LAYER_WITH_CONTEXT('COLA_MARKETS','SHAPE','VAL_RESULTS');
    Call completed.
    SQL> SELECT * from val_results;
    SDO_ROWID
    RESULT
    Rows Processed <12>
    AAABXNAABAAAKYAAC+
    +13349 [Element <1>] [Ring <1>][Edge <1>][Edge <3>]+
    CREATE TABLE val_results (sdo_rowid ROWID, result varchar2(1000));
    would have been in your case:
    CREATE TABLE schema.validity (sdo_rowid ROWID, result varchar2(1000));
    CALL SDO_GEOM.VALIDATE_LAYER_WITH_CONTEXT('COLA_MARKETS','SHAPE','VAL_RESULTS');
    would have been in your case:
    CALL SDO_GEOM.VALIDATE_LAYER_WITH_CONTEXT('SCHEMA.TABLE','GEOM','SCHEMA.VALIDITY');
    SQL> SELECT * from val_results;
    would have been in your case:
    SELECT * from schema.validity;
    If you would like to have your id included:
    Select a.id, b.*
    from schema.validity b left outer join schema.table a
    on (b.sdo_rowid= a.rowid);
    In order to help people making their life easier with the management of spatial metadata, spatial index and geometry validation, like yours, and possible fix up, 1Spatial has a product named Radius Check.
    Have a look at the second item from the top here: http://www.oracle.com/technology/products/spatial/htdocs/spatial_partners_downloads.html
    or
    http://www.1spatial.com/products/radius_check/index.php
    Maybe you can find it usefull.
    Luc

  • Loading shapefiles into Oracle Spatial

    Fellow Oracle Spatiallers!
    Currently we edit Oracle Spatial data by checking data out into a shapefile,
    making our changes off-line, and reloading the shapefile back into Oracle.
    Instead of using the Oracle Spatial supplied tool, we decided to purchase
    a utility called the "Spatial Loader" from a company called Geometry Pty Ltd
    (http://www.geometryit.com). There are a number of reasons why we decided to
    go that way which might become evident from the command line parameters of
    this utility:
    Usage: Shp2Spt [Arguments] [Options]
    OR
    Usage: Java com.geometryit.spatialloader.oracle.AdvancedJavaSpatialTranslator [Arguments] [Options]
    [Arguments] must specify these values:
    -o create
    type of operation to perform
    create creates a new table, must not exist already
    recreate creates a new table, may exist already
    init drops existing table, creates a new one
    append appends data onto existing table
    -f <shape_file>
    the shape file or project to translate
    -l <table,column>
    target table and column for the geometry data
    -D <database>
    target database name
    -u <username>
    username for RDBMS
    -p <password>
    password for RDBMS
    [Options] values are not necessarily required:
    -s <server_name>
    name of server with database
    -port <port_number>
    the port to connect to on the server
    -ufi <column_name>
    specify the name of the UFI field (unique ID)
    -seq <sequence_name>
    specify the sequence to use for the spatial data unique IDs
    -a none
    attributes mode
    none no attributes will be transferred
    all all attribtues will be transfered as found
    file= file containing lines of the form:
    <shape_attribute><space/tab><rdbms_column>
    where
    <shape_attribute> selects the column to be output
    <rdbms_column> name of the column in RDBMS
    -srid <id>
    specify the Spatial Reference ID for the spatial data
    (this must be set to use Spatial Reference Transformations)
    -i [<level>] or -i rtree
    create an index for the generated table
    the <level> parameter is an optional integer
    representing the depth of the quadtree created
    if rtree is specified, the index created will be
    an rtree
    -c <commit_interval>
    number of rows to commit after
    -t <tolerance>
    tolerance value for metadata
    -r none
    used to determine number of decimal places to round vertices to
    if you use the tolerance-parameter option, specify the -t parameter before -r
    -igc
    ignore geometry collections
    -sgc
    split geometry collections
    -sgd f
    split geometry direction [forward | reverse]
    -update-metadata <true/false>
    update the Oracle Spatial Metadata table after loading data
    -validate <true/false>
    perform Oracle Spatial validation after loading data
    -v
    verbose mode on
    -h or -?
    display this help message
    The main things I like about this tool are:
    1. One step (no conversion to sqlloader form followed by a call to the sqlloader).
    2. The ability to round the coordinates of the shapes in the shapefile by applying
    the XY tolerance values held in the SDO_GEOM_METADATA table.
    This is quite important because our editing package - due to double/single precision
    issues - can actually move coordinates but those movements are sub the precision of
    the actual data. By rounding to the nominate precision we can detect situations where
    no actual change to the shape (and its attributes) was made and thus not create superfluous
    revisions within the database.
    3. It will correctly re-wind the coordinates of the outer/inner shells of polygons. This is
    important as ESRI shapefiles are agnostic on the winding order: an outer shell coordinates
    can be listed in either clockwise or anti-clockwise order.
    4. You can specify the primary key (UFI) column (numeric) and an Oracle Sequence number such
    that each new shape loaded can have its UFI assigned from that sequence.
    Because of this flexibility, and the excellent support (it is a purchasable product) from the
    developers, I can heartily recommend this loader to fellow Spatiallers. It is worth every
    penny I spent on it. Try the free version on their website and if, like me, you like it,
    purchase it!
    regards
    Simon

    Hi Shuan,
    As part of the zip file created for the next training course to be posted for Oracle Spatial on OTN (within the next few weeks) there is a free (unsupported, undocumented) version of a shape to sdo converter. This should work, but it is unsupported. It will create a layer that then needs to be migrated into 8.1.6 format.
    If you need it quite soon send email to [email protected] and I can get it to you.
    Hope this helps,
    dan

  • Help define the requirements for an Oracle Spatial management tool

    Hi,
    We are developing a tool that, we hope, will be indispensable for all Oracle Spatial and Locator dbas/users. We've released version 1.0, but we need your help to define the requirements for the next version.
    What features would you like to have in a management tool for your spatial databases?
    The features we've got so far:
    1. Viewing of vector data in a map + attributes
    2. Loading from shapefiles
    3. Exporting to shapefiles
    4. Validating metadata, indexes and spatial data.
    We are adding editing of vectors in the next version - basic stuff for add, update and delete.
    But there must be a lot more. What do you find difficult to do in Oracle Spatial/Locator? What would you like in a tool such as this?
    Any feedback either to myself or the forum is much appreciated.
    cheers,
    Andrew
    [email protected]
    PS If you like to have a look at what we have done so far, go to http://www.geometryit.com/products/spatialConsole.php

    Andrew knows what I have asked for but for others to think about and to start
    the ball rolling, here's what they are:
    1. Ability to enter own SQL commands but with PARAMETERS for attributes
    and shapes as in the following examples:
    SELECT ...
    FROM my_spatial_table a
    WHERE a.ATTRIBUTE = :attr
    AND MDSYS.SDO_RELATE(a.shape,:polygon,'mask=anyinteract') = 'TRUE'
    When executed the attribute value is asked for via a input box (data type?)
    and the user is asked to define the SDO_GEOMETRY for the :polgygon parameter via mouse clicks on the screen.
    Similarly, this would work for INSERT, UPDATE and DELETE...
    INSERT INTO my_spatial_table (shape) values(:polygon)
    The data type of an attribute parameter could be determined in two ways:
    a) By querying the Oracle catalog;
    b) By using a "PARAMETERS" command before the query as follows
    PARAMETERS name type [(size)] [, name type [(size)] ...]
    The PARAMETERS declaration has these parts:
    name     The name of the parameter.
    type     The type of the parameter.
    size     The size of the parameter in characters or bytes.
    2. When executing an SQL SELECT statement I would like the tool
    to suggest the HINTS that are needed to improve performance.
    3. Following on from 2, I would like to Tick an option that would return the
    EXPLAIN PLAN that the query optimizer used when executing my query.
    4. The tool has to support ALL Oracle's spatial vector data types.
    5. It would be nice to be able to work with GeoRasters. Since Spatial Console
    imports/exports shapefiles why not the same for rasters. However, the problem
    with supporting foreign data formats is WHERE DO YOU STOP!!!!!
    6. You could allow for the styling of the Spatial Console to be stored in the MapViewer catalogs or use the MapViewer catalogs when styling an Sdo_Geometry if it exists (I note that your tool extracts the SDO_METADATA
    why not the MapViewer metadata as well)?
    regards
    S.

  • Oracle Spatial Performance with 10-20.000 users

    Does anyone have any experience when Oracle Spatial is used with say 20.000 concurrent users. I am not interested in MapViewer response time, but lets say there is:
    - an app using 800 different tables each having an sdo_geometry column
    - the app is configured with different tables visible on different view scales
    - let's say an average of 40-50 tables is visible at any given time
    - some tables will have only a few records, while other can hold millions.
    - there is no client side caching
    - clients can zoom in/out pan.
    Anwers I am interested in:
    - What sort of server would be required
    - How can Oracle serve all that data (each Refresh renders the map and retrieves the data over the wire as there is no client side caching).
    - What sort of network infrastructure would be required.
    - Can clients connect to different servers and hence use load balancing or does Oracle have an automatic mechanism for that?
    Thanks in advance,
    Patrick

    Patrick, et al.
    There are lots of things one can do to improve performance in mapping environments because of a lot of the visualisation is based on "background" or read-only data. Here are some "tips":
    1. Spatially sort read-only data.
    This tip makes sure that data that is close to each other in space are next to each other on disk! Dan gave a good suggestion when he referenced Chapter 14, "Reorganize the Table Data to Minimize I/O" pp 580- 582, Pro Oracle Spatial. But just as easily one can create a table as select ... where sdo_filter() where the filtering object is an optimized rectangle across the whole of the dataset. (This is quite quick on 10g and above but much slower on earlier releases.)
    When implementing this make sure that the created table is created such that its blocks are next to each other in the tablespace. (Consider tablespace defragmentation beforehand.) Also, if the data is READ ONLY set the PCTFREE to 0 in order to pack the data up into as small a number of blocks as possible.
    2. Generalise data
    Rendering spatial data can be expensive where the data is geometrically detailed (many vertices) esp where the data is being visualised at smaller scales than it was captured at. So, if your "zoom thresholds" allow 1:10,000 data to be used at 1:100,000 then you are going to have problems. Consider pre-generalising the data (see sdo_util.simplify) before deployment. You can add multiple columns to your base table to hold this data. Be careful with polygon data because generalising polygons that share boundaries will create gaps etc as the data is more generalised. Often it is better to export the data to a GIS which can maintain the boundary relationships when generalising (say via topological relationships).
    Oracle's MapViewer has excellent on-the-fly generalisation but here one needs to be careful. Application tier caching (cf Bryan's comments) can help here a lot.
    3. Don't draw data that is sub-pixel.
    As one zooms out objects become smaller and smaller until they reach a point where the whole object can be drawn within a single pixel. If you have control over your map visualisation application you might want to consider setting the SDO_FILTER parameter "min_resolution" flag dynamically so that its value is the same as the number of meters / pixel (eg min_resolution=10). If this is set Oracle Spatial will only include spatial objects in the returned search set if one side of a geometry's MBR is greater than or equal to this value. Thus any geometries smaller than a pixel will not be returned. Very useful for large scale data being drawn at small scales and for which no selection (eg identify) is required. With Oracle MapViewer this behaviour can be set via the generalized_pixels parameter.
    3. SDO_TOLERANCE, Clean Data
    If you are querying data other than via MBR (eg find all land parcels that touch each other) then make sure that your sdo_tolerance values are appropriate. I have seen sites where data captured to 1cm had an sdo_tolerance value set to a millionth of a meter!
    A corollary to this is make sure that all your data passes validation at the chosen sdo_tolerance value before deploying to visualisation. Run sdo_geom.validate_geometry()/validate_layer()...
    4. Rtree Spatial Indexing
    At 10g and above lots of great work went in to the RTree indexing. So, make sure you are using RTrees and not QuadTrees. Also, many GIS applications create sub-optimal RTrees by not using the additional parameters available at 10g and above.
    4.1 If your table/column sdo_geometry data contains only points, lines or polygons then let the RTree indexer know (via layer_gtype) as it can implement certain optimizations based on this knowledge.
    4.2 With 10g you can set the RTree's spatial index data block use via sdo_pct_free. Consider setting this parameter to 0 if the table/column sdo_geometry data is read only.
    4.3 If a table/column is in high demand (eg it is the most commonly used table in all visualisations) you can consider loading (a part of) the RTree index into memory. Now, with the RTree indexing, the sdo_non_leaf_tbl=true parameter will split the RTree index into its leaf (contains actual rowid reference) and non-leaf (the tree built on the leaves) components. Most RTrees are built without this so only the MDRT*** secondary tables are built. But if sdo_non_leaf_tbl is set to true you will see the creation of an additional MDNT*** secondary table (for the non_leaf part of the rtree index). Now, if appropriate, the non_leaf table can be loaded into memory via the following:
    ALTER TABLE MDNT*** STORAGE(BUFFER_AREA KEEP);
    This is NOT a general panacea for all performance problems. One should investigate other options before embarking on this (cf Tom Kyte's books such as Expert Oracle Database Architecture, 9i and 10g Programming Techniques and Solutions.)
    4.4 Don't forget to check your spatial index data quality regularly. Because many sites use GIS package GUI tools to create tables, load data and index them, there is a real tendency to not check what they have done or regularly monitor the objects. Check the SDO_RTREE_QUALITY column in USER_SDO_INDEX_METADATA and look for indexes with an SDO_RTREE_QUALITY setting that is > 2. If > 2 consider rebuilding or recreating the index.
    5. The rendering engine.
    Whatever rendering engine one uses make sure you try and understand fully what it can and cannot do. AutoDesk's MapGuide is an excellent product but I have seen it simply cache table/column data and never dynamically access it. Also, I have been at one site which was running Deegree and MapViewer and MapViewer was so fast in comparison to Deegree that I was called in to find out why. I discovered that Deegree was using SDO_RELATE(... ANYINTERACT ...) for all MBR queries while MapViewer was using SDO_FILTER. Just this difference was causing some queries to perform at < 10% of the speed of MapViewer!!!!
    6. Consider "denormalising" data
    There is an old adage in databases that is "normalise for edit, denormalise for performance". When we load spatial data we often get it from suppliers in a fairly flat or normalised form. In consort with spatial sorting, consider denormalising the data via aggregations based on a rendering attribute and some sort of spatial unit. For example, if you have 1 million points stored as single points in SDO_GEOMETRY.SDO_POINT which you want to render by a single attribute containing 20 values, consider aggregating the data using this attribute AND some sort of spatial BUCKET or BIN. So, consider using SDO_AGGR_UNION coupled with Spatial Analysis and Mining package functions to GROUP the data BY <<column_name>> and a set of spatial extents.
    6. Tablespace use
    Finally, talk to your DBA in order to find out how the oracle database's physical and logical storage is organised. Is a SAN being used or SAME arranged disk arrays? Knowing this you can organise your spatial data and indexes using more effective and efficient methods that will ensure greater scalability.
    7. Network fetch
    If your rendering engine (app server) and database are on separate machines you need to investigate what sort of fetch sizes are being used when returning data from queries to the middle-tier. Fetch sizes for attribute only data rows and rows containing spatial data can be, and normally are, radically different. Accepting the default settings for these sizes could be killing you (as could the sort_area_size of the Oracle session the application server has created on the database). For example I have been informed that MapInfo Pro uses a fixed value of 25 records per fetch when communicating with Oracle. I have done some testing to show that this value can be too small for certain types of spatial data. SQL Developer's GeoRaptor uses 100 which is generally better (but this one can modify this). Most programmers accept defaults for network properties when programming in ADO/ODBC/OLEDB/JDBC: just be careful as to what is being set here. (This is one of the great strengths of ArcSDE: its TCP/IP network transport is well written, tuneable and very efficient.)
    8. Physical Format
    Finally, while Oracle's excellent MapViewer requires data its spatial data to be in Oracle, other commercial rendering engines do not. So, consider using alternate, physical file formats that are more optimal for your rendering engine. For example, Google Earth Enterprise "compiles" all the source data into an optimal format which the server then serves to Google Earth Enterprise clients. Similarly, a shapefile on local disk to the application server (with spatial indexing) may be faster that storing the data back in Oracle on a database server that is being shared with other business databases (eg Oracle financials). If you don't like this approach and want to use Oracle only consider using a dedicated Oracle XE on the application server for the data that is read only and used in most of your generated maps eg contour or drainage data.
    Just some things to think about.
    regards
    Simon

  • Acquiring Oracle Spatial Data through WFS

    Hi,
    I have been researching for awhile and am slightly confused.
    I have Oracle Spatial 11g with geometry data and would like to be able to retrieve that data through a WFS to serve to a viewing application.
    Here's where I am confused:
    1) Spatial has a WFS service which needs to be configured. If I were configure that, would I be able to access the data through URL getFeature commands? The documentation I see for them has the getFeature requests in the form of XML files so I am not sure if I can do that. Also it seems like the service is returning .log files but I think I would want GML...
    If this is the option I should take, the tutorial to setup OC4J and the Web Services are for a Linux machine (http://www.oracle.com/technology/obe/11gr1_db/datamgmt/spatialws/spatialws.htm) -- Is there one for Windows 64bit?
    2) Do I need another "application layer" to enable this URL support? I know MapServer can use URL requests.. can I just run this against the data in my DB and forget about the Oracle WFS?
    3) MapViewer seems to work with WFS Themes and handle requests through Java and SQL.. is this another option?
    I am basically confused as to where everything sits and what I should be focusing on to get my Spatial data out of the DB through a WFS. Any assistance on this matter would be greatly appreciated!
    Thanks!

    Any help debugging this issue would be greatly appreciated:
    As per the documentation:
    http://localhost:8888/SpatialWS-SpatialWS-context-root/wfsservlet?request=GetCapabilities&service=wfs&version=1.0.0
    :this get request should return the capabilities info however I receive this error message instead in the browser:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ogc:ServiceExceptionReport version="1.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/ogc http://localhost:8888/examples/servlets/xsds/OGC-exception.xsd" xmlns:ogc="http://www.opengis.net/ogc">
    <ogc:ServiceException code="WFS-1042">Exception during processing request</ogc:ServiceException>
    </ogc:ServiceExceptionReport>
    The sytem out from the oc4j container provides this error message:
    10/04/27 15:47:38 [oracle.spatial.ws.WSProperties, Tue Apr 27 15:47:38 MDT 2010,
    INFO] No subject specified in request.
    10/04/27 15:47:38 [oracle.spatial.ws.WSProperties, Tue Apr 27 15:47:38 MDT 2010,
    ERROR] Oracle Spatial WS Server could not set up configuration parameters: jav
    a.lang.RuntimeException: No subject specified in request.
    10/04/27 15:47:38 [oracle.spatial.ws.servlet.WFSServlet, Tue Apr 27 15:47:38 MDT
    2010, FATAL] java.lang.RuntimeException: java.lang.RuntimeException: No subject
    specified in request.
    at oracle.spatial.ws.WSProperties.getProperties(WSProperties.java:705)
    at oracle.spatial.ws.servlet.WFSServlet.doGet(WFSServlet.java:108)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletReque
    stDispatcher.java:734)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(Ser
    vletRequestDispatcher.java:391)
    at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequ
    estHandler.java:908)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpReques
    tHandler.java:458)
    at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpReque
    stHandler.java:226)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.ja
    va:127)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.ja
    va:116)
    at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSo
    cketReadHandler.java:260)
    at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(Server
    SocketAcceptHandler.java:234)
    at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocket
    AcceptHandler.java:29)
    at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(
    ServerSocketAcceptHandler.java:879)
    at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(Relea
    sableResourcePooledExecutor.java:303)
    at java.lang.Thread.run(Thread.java:619)
    Caused by: java.lang.RuntimeException: No subject specified in request.
    at oracle.spatial.ws.WSProperties.getUser(WSProperties.java:574)
    at oracle.spatial.ws.WSProperties.getProperties(WSProperties.java:695)
    ... 16 more

  • Extrude 3D polygons in Oracle spatial

    Dear Everyone,
    I have two data sets of the city footprints imported in the Oracle Spatial already. One is a 2D polygon layer with only x and y, and the other is a 3D polygon layer with z values (the x and y are identical to the first one).
    Now I am trying to extrude the 3D polygon to 3D composites based on the z value. I can successfully extrude the 2D polygons with specifying the ground heights (say sdo_ordinate_array(0)) and topheights (say, sdo_ordinate_array(20.0)).
    However, how to extrude the 3D polygon taking each vertex's z value as the ground heights to an specified top heights is a problem for me. Since, I am very new to use PL/SQL, besides, I am not sure if it is possible to do this.
    Here is the sample data extracted from the sample data:
    select sample.geom.sdo_ordinates from sample2d_polygon sample
    NUMBER(715202.739577727,733492.909091357,715206.759608945,733492.412077086,715208.666575034,733506.889047512,715204.72752625,733507.364066093,715202.739577727,733492.909091357)
    select sample.geom.sdo_ordinates from sample3d_polygon sample
    NUMBER(715202.739577727,733492.909091357,12.4890003204346,715206.759608945,733492.412077086,12.4890003204346,715208.666575034,733506.889047512,12.4540004730225,715204.72752625,733507.364066093,12.4320001602173,715202.739577727,733492.909091357,12.4890003204346)
    Can anybody help me about this
    select sdo_util.extrude(sample.geom, sdo_ordinate_array(), sdo_ordinate_array(20.0), 'true', 0.05) from sample2d_polygon sample, where the first sdo_ordinate_array is the array of corresponding vertex's z value?
    Any suggestions is anticipated and highly appreciated.
    Sincerely
    Jun

    Hi Jun,-
    I hope the following code solves your problem.
    Please also make sure your geometries are valid using sdo_geom.validate_geometry_with_context or
    sdo_geom.validate_layer_with_context for 3D geometries.
    Please let us know if you have questions.
    Best
    baris
    drop table myGeoms;
    drop table extruded_myGeoms;
    create table myGeoms(i number, geom sdo_geometry);
    insert into myGeoms(i, geom) values(1,
    MDSYS.SDO_GEOMETRY(3003, null,null,
    MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1),
    MDSYS.sdo_ordinate_array(
    715202.739577727,733492.909091357,12.4890003204346,
    715206.759608945,733492.412077086,12.4890003204346,
    715208.666575034,733506.889047512,12.4540004730225,
    715204.72752625, 733507.364066093,12.4320001602173,
    715202.739577727,733492.909091357,12.4890003204346
    insert into myGeoms(i, geom) values(2,
    MDSYS.SDO_GEOMETRY(3003, null,null,
    MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1),
    MDSYS.sdo_ordinate_array(
    715202.739577727,733492.909091357,14.4890003204346,
    715206.759608945,733492.412077086,14.4890003204346,
    715208.666575034,733506.889047512,14.4540004730225,
    715204.72752625, 733507.364066093,14.4320001602173,
    715202.739577727,733492.909091357,14.4890003204346
    insert into myGeoms(i, geom) values(3,
    mdsys.sdo_geometry(3003, null, null,
    mdsys.sdo_elem_info_array(1,1003,1),
    mdsys.sdo_ordinate_array(1,1,10,  0,1,10, 0,0,10, 1,0,10, 1,1,10))
    create table extruded_myGeoms(id number, geom sdo_geometry);
    -- This program assumes that each geometry in myGeoms table
    -- has only 1 ring per polygon ie, 1003 etype element.
    set serveroutput on;
    declare
    type cursor_type is REF CURSOR;
    query_crs cursor_type ;
    -- For each extruded geometry (result), this array has the ground heights
    ords_bottom_z_array sdo_number_array  := null;
    -- For each extruded geometry (result), this array has the top heights which is set to 20 for each element.
    -- Both arrays must have the same number of elements.
    ords_top_z_array sdo_number_array  := null;
    ords2d mdsys.sdo_ordinate_array  := null;
    result sdo_geometry;
    g1 sdo_geometry;
    g2d sdo_geometry;
    stmt  varchar2(100);
    id1 number;
    cnt integer;
    k integer;
    l integer;
    the_dim        number;
    gtype_2d       number;
    begin
    stmt := ' select i, geom from myGeoms ';
    OPEN query_crs FOR stmt;
    LOOP
      BEGIN
       FETCH query_crs into id1, g1;
       EXIT when query_crs%NOTFOUND ;
       ords2d := mdsys.sdo_ordinate_array();
       ords_bottom_z_array := SDO_NUMBER_ARRAY();
       ords_top_z_array := SDO_NUMBER_ARRAY();
       k:=ords_bottom_z_array.count;
       l:=ords2d.count;
       FOR cnt in 1..g1.sdo_ordinates.count LOOP
         if (mod(cnt, 3) = 0) then
           -- Get z values of polygon
           ords_bottom_z_array.extend(1);
           ords_top_z_array.extend(1);
           k:=k+1;
           ords_bottom_z_array(k) := g1.sdo_ordinates(cnt);
           ords_top_z_array(k) := 20.0; -- Constant
         else
           -- To have 2D geometry for input to sdo_util.extrude
           ords2d.extend(1);
           l := l+1;
           ords2d(l) := g1.sdo_ordinates(cnt);
         end if;
       end loop;
       the_dim := floor(g1.sdo_gtype / 1000);
       gtype_2d := (the_dim-1)*1000 + mod(g1.sdo_gtype, 10);
       g2d:= sdo_geometry(gtype_2d, null,  null,
               mdsys.sdo_elem_info_array(1,1003,1),
               ords2d);
       result:= sdo_util.extrude(g2d, ords_bottom_z_array, ords_top_z_array, 'FALSE', 0.05);
       -- insert the extruded geometry (result) into new table
       insert into extruded_myGeoms(id, geom) values(id1, result);
       dbms_output.put_line('id = '||id1);
      END;
    END LOOP;
    end;
    /

Maybe you are looking for