Oracle Spatial functionality with WFS

Hi all
My first post here so be gentle on me ;-)
This may be an obvious question but here goes ...
When using a WFS client can you access the full SDO_... SQL functions within Oracle Spatial? I've had a read of the WFS spec and it is all a bit vague on how the queries get passed through to the data store.
Also with the WFS locking, is this done at the web server level? If so how would that impact on any direct access to the database? A bit dangerous??
Appreciate any advice on WFS implemtations with a 9i back end. I want to retain the full native Oracle functionality and still deploy via WFS ... a pipe dream??
Thanks
Richard

Thanks for your response Andreas
Sorry, perhaps I wasn't clear, I realise the WFS client will never directly access the data source, that it is the WFS server that makes the request to the data store, not the client, but can the call be passed through to Oracle as native SQL?
I think I found the answer in the OGC Filter Encoding Imp Spec where it desribes in great detail the optional filter component of a WFS request. It desribes the CQL filter operators that include some spatial operators. These could, I understand, be translated from CGL and Feature based schema to SQL (in GML?) and relational based schema.
While I don't think at first glance that the spatial operators in CQL match all the Oracle SDO_ functions they probably go far enough for most normal users.
Am I on the right track?
Does anyone know of any work that has been done in this filter translation to SQL and if it has been implemented successfully anywhere.
I think the locks would still pose a problem, but that's for another day :-)
Thanks
Richard

Similar Messages

  • 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

  • Oracle map function  with spatial

    Hi Experts,
    I have a database10.2.0.4 in red hat 5.0. the java application at 32 bit winrow 2003 sp2 server with tocmat ISS server6.0.
    Last week, the IE or forefox broower could not display oracle map when window server updated into 2008.
    all of other oracle function works well. We do not get any error message for this event.
    Does any expert have experience for this issue?
    Thanks
    Jim

    Try looking at this as a first step http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/10g/r2/prod/datamgmt/spatial/spatial_otn.htm?cid=4553&ssid=0 that will give you a primer on getting data in and out of Oracle Spatial.  You will find lots of tutorials on the web.  There is no substitute for reading the manuals - http://docs.oracle.com/cd/E16655_01/nav/portal_7.htm#oracle_spatial_and_location_information
    I can highly recommend a book called Pro Oracle Spatial The 12c version is due out in June but the 11g version will get you started,

  • 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

  • Oracle Spatial function to find nearest line string based on lat/long

    Hi,
    Here is my scenario. I have a table that contains geometries of type line strings (the roadway network). The line geomteries are of type Ohio state plane south (SRID 41104).
    I have a requirement - given a lat/long, find the line string that snaps to that lat/long or the nearest set of line strings within a distance of 0.02 miles.
    This is a typical example of trying to identify a crash location on our roadway network. The crashes being reported to us in lat/long thru the GPS system.
    How can i acheive this through any spatial functions?
    Thanks for the help in advance.
    thanx,
    L.

    Hi L,
    That is not the way I would do it. I would convert my road segments to LRS data, then you can do all queries on the same data.
    Or, if you do not want to modify your original data, create a copy of your road segments with the same ID's and convert the copy into LRS data. If you keep the ID's identical, you can easily use geometry from one and LRS data from the other - as long as you are sure the ID is the same.
    Which will make the workflow a bit easier:
    1. Use SDO_NN to get the closest segments
    2. Use SDO_LRS.PROJECT_PT to get the projected point
    3. Use SDO_LRS.GET_MEASURE to get the measure
    And most of these you can incorporate into one single query. Now I am writing this of the top of my head (It's been a while since I played with LRS). so this has not been tested, but something like this should work (but could probably be greatly improved - it's getting late for me :-) ):
    SELECT
    SDO_LRS.FIND_MEASURE  --//find_measure needs an LRS segment and a point
        SELECT            --//here we select the LRS segment
          r.geometry 
        FROM
          roadsegments r
        WHERE SDO_NN(r.geometry,    --//based on the given GPS point
                     sdo_geometry(2001, 41104, sdo_point_type(lat,lon,NULL), NULL, NULL), 
                     'sdo_num_res=2 distance=0.02 unit=mile') = 'TRUE'
      SDO_LRS.PROJECT_PT  --//We project the point on the LRS segment
          SELECT         --//here we select the LRS segment (again, which could probably be improved!!)
            r.geometry 
          FROM
            roadsegments r
          WHERE SDO_NN(r.geometry,
                       sdo_geometry(2001, 41104, sdo_point_type(lat,lon,NULL), NULL, NULL), 
                       'sdo_num_res=2 distance=0.02 unit=mile') = 'TRUE'
        sdo_geometry(2001, 41104, sdo_point_type(lat,lon,NULL), NULL, NULL) --//The GPS point again
    AS milemarker from dual;So it is not as complicated as you think, it can easily be done with just one query (SQL can do a lot more than you think ;-) ).
    Good luck,
    Stefan

  • How oracle spatial deals with self-looping polylines?

    Hi,folks
    I have a general question on self-looping polylines.
    If one polyline is self-closing, can oracle spatial recognize it as a line or polygon?
    Anyone can give some hints on that?

    HI!
    Review this page:
    http://download-west.oracle.com/docs/cd/A91202_01/901_doc/appdev.901/a88805/sdo_intr.htm#877625
    They say that "Self-crossing polygons are not supported, although self-crossing line strings ARE supported. If a line string crosses itself, it does not become a polygon. A self-crossing line string does not have any implied interior."
    Also, line strings are defined with their own SDO_GTYPE, such as "DL06" for MULTILINE or MULTICURVE, where POLYGON is "DL03" and MULTIPOLYGON is "DL07", so they can't be confused one with another.(See http://download-west.oracle.com/docs/cd/A91202_01/901_doc/appdev.901/a88805/sdo_objr.htm#1005537)

  • Oracle spatial query with php

    Hello, I have this problem,
    I use php for read data from oracle table,
    all works right, I have any problem whith varchar number type data, but when I must read geometry data like
    (type MDSYS.SDO_GEOMETRY)
    I can't display it on the web page.
    esemple of spatial query that I use:
    select GEOMETRY_1
    from table_a
    where
    ID = 970;
    If I use sql plus I have this result
    SDO_GEOMETRY(3001, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 0, 6000, 4, 1, 1), SDO_ORDINATE_ARRAY(1, -0, -
    0, 580094, 4998494, -1))
    but blank page when I use php sentence.
    I use PHP Version 4.4.0
    modules load are:
    extension=php_sdo.dll
    extension=php_oci8.dll
    But I don't know which other module I need and also which php function to use for read array of array. at the moment I use @OCIFetchInto.
    Someone can help me?
    My English is very bad please reply easy.
    Thanks for all!
    Angelo

    Thank you very much CJ.
    Now there isn't any problems: you and this link (Re: PHP and spatial data and Adamo Bozzetti helped me
    I have used SDO_UTIL.GETVERTICES
    my complete php script is:
    $conn = @OCILogon("xxxxxx", "xxxxx", "xxxxx") or die
    ( "Non riesco a connettermi al server $host ");
    $query = "select
    TABLE_A.tipo_via,
    TABLE_A.nome_via,
    c.codice_via,
    t.X,
    t.Y
    from TABLE B c, TABLE_A , TABLE(SDO_UTIL.GETVERTICES(c.geometry1)) t
    where c.codice_via = 830
    and c.codice_via = TABLE_A.id_via
    $istruzione = @OCIParse($conn, $query);
    @OCIExecute($istruzione);
    $nrows = @OCIFetchInto($istruzione, $results);
    $trovati = 0;
    while(@OCIFetchInto($istruzione, $results))
    $trovati++;
    ?>     
    <table border width="800" >
    <tr>     
    <td align="center" width="80" bgcolor ="#aaffee"><?echo trim($results[0]);?></td>
    <td align="center" width="150" bgcolor ="#eeffee"><?echo trim($results[1]);?></td>
    <td align="center" width="50" bgcolor ="#eeffee"><?echo trim($results[2]);?></td>
    <td align="center" width="50" bgcolor ="#eeffee"><?echo trim($results[3]);?></td>
    <td align="center" width="50" bgcolor ="#eeffee"><?echo trim($results[4]);?></td>
    </tr>
    </table>
    <?
    } //fine While
    @OCIFreeStatement($istruzione);
    @OCILogOff($conn);

  • Interfacing Oracle spatial data with ArcView 9

    Hello,
    I'm trying to take my spatial data in Oracle which has SDO_GEOMETRY fields, and have it display in ArcView. I know I have to do something with SDO_GEOMETRY, but I'm not sure how. I've been reading that 3rd party tools can be used. Is this the only way, or is there something else I can do?
    Thanks much,
    Nora

    the way i use is through arcsde. register the oracle table with sde and then you can view it in any arc software.
    there is another way through direct connect. i havent used it but you can find some help on esri website.
    V

  • Oracle Spatial 10g

    Hello all
    I would like to know if is it possible to install the 10g Spatial functionality in a previous version of the database (8.1.7).
    We want to work with Oracle Spatial + ArcSDE (with versioning and Spatial as Geometry Storage) + ArcGIS-ArcIMS, but the editing software will be AutoCAD.
    We will get from the database those elements whe want to edit and put it then in AutoCAD layers . To limit the traffic, we only need the geographic primitives (points and arc, but no polygons), but as we are editing polygons, we need a process that rebuild topology. I think that the new Oracle Spatial 10 g topological functionalities could help us (so we can insert arcs in a table and get the polygons they are building, and dangle arcs).
    I suppose it will not be possible to edit directly to the geodatabase feature class if it is versioned (so all the changes will appear as consolidated), but, is it possible (and of course, easy) to rebuild via SQL an ArcSDE version?
    And finally:
    Can (and how) we use Oracle WorkSpace Manager whit ArcSDE??? , and only with AutoCAD? Any experience? I´m thinking about spatial index and mdsys metadata table. Must be these tables registered as "versioned" with Oracle WorkSpace Manager to work with spatial data?
    Thank you for all
    Jesús de Diego

    Hello all again
    First of all, thank you for your quick reply.
    I can explain a bit more what we wanna do:
    we're in a multi-platform environ. We've ArcGIS users, AutoCAD users and a ArcSDE DB. We don't want AutoCAD users to migrate to ArcEditor, but they need to edit corporative (DB) data, and, in the other hand, there will be others editors using ArcEditor capabilities, so it is possible we will need versioned (ArcSDE) data.
    I think we can edit an ArcSDE version vía AutoCAD:
    1º Data storage will be Oracle Spatial.
    2º A new version over the default will be created.
    3º When an AutoCAD editor request spatial data, we can, vía SQL, get the sdo_geometry (here is when i need to rebuild a complete version....)
    4º We load these spatial data into diferents layer in a dwg (in we can get only the geographic primitives, this will be faster)
    5º CAD users edit the information and when they finish, load arc and points (lables) into 2 temporal tables, when arcCatalog can rebild polygon topology ....
    6º Once polygons have been rebuilded, can be sended to AutoCAD again so Oracle Spatial SQL queries can be used in AutoCAD against the DB.
    7º Finally, could we insert the new records into A and D tables?, and how? using simply SQL (again we need to rebuild a version....)
    I'm all ears.......
    Thank you again
    Jesús de Diego

  • Data Retrieval Speed in Oracle Spatial vs. ESRI ArcSDE

    I would appreciate any opinions regarding data retrieval
    performance between Oracle Spatial and ESRI ArcSDE. Would an end-
    user (using ESRI software) experience significant differences in
    data retrieval speed depending on how the data were stored in
    Oracle (MDSYS.SDO_GEOMETRY verses ESRI Binary/Blob formats).
    Knowing that the ESRI binary formats are tailored to their
    software front-end apps (ArcGIS, ArcMap, ArcCatalog, and
    ArcInfo), wouldn't this be a "non-issue" until the spatial
    dataset gets "large", and even then, wouldn't performance be
    (almost) equal if the spatial indexes were created properly?
    Thanks for your inputs,
    Bruce

    John,
    You can't do that type of query in sql from sql*plus using
    SDEBINARY. HOwever, you can perform spatial queries in ArcMap
    if you are using SDEBINARY.
    You can use the query builder to perform point-in-polygon type
    queries.
    Hope that helps.
    For my two cents, I think SDO_GEOMETRY gives you a more robust
    database to work with, because you have the added power of
    Oracle Spatial functions. If you are using SDEBINARY you are
    limited to only what you can do thru ArcGIS.
    If you are concerned more about performance than accessibility,
    especially with a large number of users, then SDEBINARY might
    be the better choice.
    I love Oracle Spatial and am hoping that the performance issue
    will not be a serious one when we start putting ArcIMS developed
    apps into production.
    Dave

  • Basic query in Oracle Spatial

    I'm trying to learn Oracle Spatial working with 11g R2 and with 3D georeferenced data (specifically data describing buildings in a city).
    But I'm having trouble getting a basic query to work on my dataset (it works for the book example), and I'm trying to do it exactly the way it's done in the Spatial Developer's Guide for 11g.
    To learn how spatial queries work, I set up the cola_markets tables used in the book, made the appropriate manual entry in the user_sdo_geom_metadata view and created the index. Having done that, I can run the following simple query (as well as the others in the manual) on the book tables:
    SELECT SDO_GEOM.SDO_DISTANCE(c_b.shape, c_d.shape, 0.005)
    FROM cola_markets c_b, cola_markets c_d
    WHERE c_b.name = 'cola_b' AND c_d.name = 'cola_d';
    but when I try to do the same thing on my own tables (created from citygml data), I get an error. There is the difference that the data is 3D, and the index was created without any PARAMETERS ( ... ), hence is just 2D. But still I don't get why the following query doesn't work:
    SELECT SDO_GEOM.SDO_DISTANCE(c_w.envelope, c_b.envelope, 0.0005)
    FROM cityobject c_w,
         cityobject c_b
    WHERE c_w.id = 50025
         AND c_b.id = 50018;
    The id's for the buildings are valid, and I used the same tolerance used by the software that set up the database.
    Here's the error I get in SQL developer:
    ORA-29532: Java call terminated by uncaught Java exception: java.lang.Exception: 54535
    ORA-06512: at "MDSYS.SDO_3GL", line 637
    ORA-06512: at "MDSYS.SDO_GEOM", line 1973
    ORA-06512: at "MDSYS.SDO_GEOM", line 1990
    29532. 00000 - "Java call terminated by uncaught Java exception: %s"
    *Cause: A Java exception or error was signaled and could not be
         resolved by the Java code.
    *Action: Modify Java code, if this behavior is not intended.
    So, thinking it might have something to do with the fact that it's a Java interface, I also tried running it from SQL/PL command line and get essentially the same thing:
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.lang.Exception: 54535
    ORA-06512: at "MDSYS.SDO_3GL", line 637
    ORA-06512: at "MDSYS.SDO_GEOM", line 1973
    ORA-06512: at "MDSYS.SDO_GEOM", line 1990
    Any ideas why this isn't working?
    (P.S.: I couldn't find a specific board for Oracle Spatial, hence put this question here--if there's a better place for this question, then, admins, of course, feel free to move the thread to the appropriate spot)

    Hi,
    The SPATIAL forum is here : {forum:id=76}

  • Spatial Performance with join

    I have a Oracle Spatial table with 3.5 million rows plus another auxillary table with 3.5 million rows. A query over these two tables joined returns a full result (250 rows) based on one to one join - here's an example:
    Select count(*)
    from F, N
    where F.id = n.id and (F.GEOM,mdsys.sdo_geometry (2003,8307, null, mdsys.sdo_elem_info_array (1,1003,1), mdsys.sdo_ordinate_array(-120.0,49.5,-119.0,49.5,-119.0,60.35,-120.0,60.35,-120.0,49.5)),
    'mask= ANYINTERACT querytype=WINDOW') = 'TRUE') AND N.PNUM = '4';
    It takes an average of 35 seconds to get the full result set back. I've gathered statistics, tweaked memory parameters and this is the best I can get. Does anyone have any suggestions?

    This is an interesting problem. It looks like Oracle is doing the right thing for each of the table accesses - use the index and fetch by rowid.
    The only thing you have to play with if you don't go to materialized views or temp tables is how the results of the two table queries are joined.
    You don't have a lot of options. Hash join seems to be slow, but you don't know if it is faster or slower compared with nested loops or merge join.
    I'd compare what you have done with something like the following to test nested loops:
    select /*+ no_merge use_nl (f1,n1) */ count(*)
    from
    (select id
    from f
    where sdo_anyinteract ( F.GEOM,
    sdo_geometry (2003,8307, null, sdo_elem_info_array (1,1003,1),
    sdo_ordinate_array (-120.0,49.5,-119.0,49.5,-119.0,60.35,
    -120.0,60.35,-120.0,49.5))) = 'TRUE') f1,
    (select id
    from n
    where n.pnum='4') n1
    where f1.id=n1.id ;
    and presort with a merge join hint to see how it performs:
    select /*+ no_merge use_merge (f1,n1) */ count(*)
    from
    (select id
    from f
    where sdo_anyinteract ( F.GEOM,
    sdo_geometry (2003,8307, null, sdo_elem_info_array (1,1003,1),
    sdo_ordinate_array (-120.0,49.5,-119.0,49.5,-119.0,60.35,
    -120.0,60.35,-120.0,49.5))) = 'TRUE'
    order by id) f1,
    (select id
    from n
    where n.pnum='4'
    order by id) n1
    where f1.id=n1.id ;
    It might be that you already have the best Oracle can do, but I'd be curious to know how you make out.
    Dan Abugov
    VP Software Support and Services
    Acquis Inc.

  • Keep Oracle spatial data in memory

    Can I keep Oracle Spatial data (including metadata and related functions and procedures) in memory using TimesTen?

    It depends what form the data takes. TimesTen does not support any spatial types, only regular relational data types. Also, TimesTen does not support any of the Oracle spatial functions.
    In general this is not possible.
    Chris

  • Server Hardware for Oracle Database 11g Release 2 with Oracle Spatial

    Hi ,
    We're to set up an Oracle Database 11g Release 2 Enterprise with Oracle Spatial.
    Can you provide me the possible Server Hardware CPU / Memory specs , number of CPUs,type of OS and teh Model, for Spatial which a million users hits the database via a webservice?
    The vendor suggested us SDD instead of HDD, any performance hike on this?
    Budget seems to okay but I think Exadata will be too dear.
    Your insights is much appreciated.Anything relating to setting up a server with spatial is greatly appreciated.
    P/S: Been a programmer and don't knwo much about server hardware specs.

    It depends.
    Seriously - before anyone can offer anything but generalities here you need to really define exactly what you expect the database to deliver.
    In general however, I will throw out these questions and ideas...
    For instance - you say a million users "hit" the database (via a web service). Is that WFS, WMS, KML or ???
    Over - how long? A year? A month? A minute? A million hits over a year spread out evenly is only about 2 per minute.
    And what is a hit? A single random record? Or about 10,000 records in the same spatial area... or? And for each record - are you returning simple point data - or hugely complex polygons with thousands of vertexes each?
    How does this software work? Is it custom - or is it well known? Does it really query the database for every map (I assume it is a map service) feature - or does it read an area once and cache it in the middle tier? Or does it do something really smart and use cached tiles for static data - overlayed with vectors for dynamic data?
    And although you say Oracle Spatial - are you really using Spatial - or just Locator functions (less processing in general)? And if spatial - are you doing raster in the db - or 3D analysis - or other special functionality?
    SSD vs. HDD. - If you can buy a server with more RAM than the data set size (pretty easy these days) - and you do mostly reads (almost always the case for a map app) - buy a small cheap array of RAID'd HDD's - internal to the server is fine. Once the data is read into RAM - the HDD's do basically nothing.
    Server CPU and memory. Amount - see above. CPU Speed (use performance benchmarks - not GHz numbers) AND memory speed (often overlooked) - buy as fast as possible. Why? You pay for licenses by the core (2 cores per license for x64). And HW is MUCH MUCH MUCH cheaper than Oracle licenses. Plan to upgrade HW every year if necessary to avoid buying more licenses (sounds crazy - but it is much cheaper).
    This may seem like a lot - but these questions are just the tip of the iceberg. I have been in charge of spec'ing, building, and programming spatial systems now for about 20 years, so I have a pretty good idea of how to do enterprise scale computing on a Ramon-noodle budget.
    Smart clean software is your friend - don't ask the HW to do anything unless absolutely necessary (cache results and reuse as much as possible), and you can get crazy performance from minimal hardware.
    Bryan

  • Using Java with Oracle Spatial

    I am using the JDBC (Java classes dowloaded from
    technet.oracle.com - (sdoapi.zip)) together with Oracle Spatial
    8.1.6. I am writing a collection of Linestrings into Oracle
    Spatial using the supplied java classes(sdoapi.zip). I use the
    function createGeometryCollection(myCollection)to write the
    Linestring collection to Oracle Spatial and they are written to
    the database without error. However, when I try to read the
    object back I get the following error:
    Exception in thread "main"
    oracle.sdoapi.geom.InvalidGeometryException
    at oracle.sdoapi.adapter.AdapterSDO.importGeometry
    (AdapterSDO.java:101)
    at
    MapInfoToOracleSpatial.MapInfoToOracleSpatial.main
    (MapInfoToOracleSpatial.java:211)
    I do not have a listing of this code so can you please tell me
    what the error is (line of code) at line 211. Also, when I use
    the Oracle Spatial Index Advisor to view the spatial data, it
    only displays a quarter of the data. When I use MapInfo to view
    it's equivalent TAB (Table) file it views correctly all the
    data.
    I can't understand why this is happening because the writing to
    oracle and creation of each individual linestring does not
    throw an error. It is only when I try to read back larger
    objects from the database (2500 points) that it gives an error.
    Is there a limitation on the size one can create linestrings?
    Thanks
    Regards
    Stephen Syrett
    Mobile Telecommunications Network
    (MTN) South Africa

    Latest Oracle Openworld Spatial/MapViewer activities list:
    http://www.oracle.com/us/products/database/options/spatial/ssLINK/oow10-focuson-spatial-169204.pdf
    thanks
    LJ

Maybe you are looking for