Spatial LRS

Hi,
I am new to Oracle Spatial and Linear Referencing System. I checked with the user guide, and found very limited functions available such as: define, clip, split, concatenate, scale a geometric segment, locate a point on a geometric segment etc.
My question is whether or not LRS supports additional analysis functionality such as event overlay?
Here is an example: one route is from 0 to 100 miles; from 20 to 50 miles is a pavement road, from 30 to 80 miles has high traffic accidents. Can we retrieve road (from where to where mile post information) that is pavement and has high traffic accidents?
A SQL statement might be:
select * from route table where event = 'pavement' and event = 'high traffic accidents'.
Thanks a lot.
Feng Lu
null

Hi Feng Lu,
This might require more than one table.
For instance, you might have a table called roads that includes lrs information as well as attribute data (road name, etc) and a key that other tables can join on.
To do what you are trying to do, you might have additional tables, such as an accidents table that contains an entry for every accident, with information such as where the accident happened as a measure value only, a pointer using the key back to the road the accident happened on, and perhaps other information such as accident cause, etc.
Another additional table you might have is a road_condition table, with information about road condition such as: condition, start measure for that condition, end measure for that condition, when the last time the road was inspected, and a key back to the roads data.
The you could query the database getting whatever information is required from the three tables.
Hope this helps,
dan

Similar Messages

  • Oracle Spatial LRS point X and Y.

    I’m having some problems with LRS points.
    Two tables: A and b. Table A contains valid LRS linestrings; table B (non spatial) is a list of points with stated eastings and northings columns that exist in close proximity to the linestrings. Points are associated to the linestring by a.unique_id.
    I’m successfully projecting the b.points onto their a.linestrings using SDO_LRS.PROJECT_PT passing the a.geometry and constructing a geometry from b.eastings and b.northings.
    So far so good. I can get the measure by nesting SDO_LRS.GET_MEASURE; and offset with SDO_LRS.GET_OFFSET. Meaning that the returned value from SDO_LRS.PROJECT_PT is a valid LRS point (SDO_GTYPE=3301):
    (3301, 81989, (0, 0, ), (1, 1, 1, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ), (525121.71247406, 185976.696321595, 21.4631188722804, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ))
    This is my problem: how do I extract the X and Y from the SDO_LRS.PROJECT_PT returned value?
    This work so far:
    SELECT a.unique_id,
    b.point_id,
    SDO_LRS.GET_MEASURE
    SDO_LRS.PROJECT_PT
    a.geoloc,
    b.SDO_GEOMETRY (2001,81989,SDO_POINT_TYPE(b.def_easting,b.def_northing,NULL),NULL,NULL)
    ABS(SDO_LRS.FIND_OFFSET
    a.geoloc,
    b.SDO_GEOMETRY (2001,81989,SDO_POINT_TYPE(b.def_easting,b.def_northing,NULL),NULL,NULL)
    FROM road_network a,points b
    WHERE a.unique_id = b.roads_id
    I’d like to add the following selections but it does not work:
    SDO_LRS.PROJECT_PT
    a.geoloc,
    b.SDO_GEOMETRY (2001,81989,SDO_POINT_TYPE(b.def_easting,b.def_northing,NULL),NULL,NULL)
    ).SDO_POINT.X,
    SDO_LRS.PROJECT_PT
    a.geoloc,
    b.SDO_GEOMETRY (2001,81989,SDO_POINT_TYPE(b.def_easting,b.def_northing,NULL),NULL,NULL)
    ).SDO_POINT.Y
    And this one neither (just a couple of brackets, sign of desperation!):
    (SDO_LRS.PROJECT_PT
    a.geoloc,
    b.SDO_GEOMETRY (2001,81989,SDO_POINT_TYPE(b.def_easting,b.def_northing,NULL),NULL,NULL)
    )).SDO_POINT.X
    (SDO_LRS.PROJECT_PT
    a.geoloc,
    b.SDO_GEOMETRY (2001,81989,SDO_POINT_TYPE(b.def_easting,b.def_northing,NULL),NULL,NULL)
    )).SDO_POINT.Y
    It always returns 0.
    When you look at the SDO_LRS.PROJECT_PT returned value you’ll see the following only ordinates: 525121.71247406, 185976.696321595, 21.4631188722804
    525121.71247406 being the X;
    185976.696321595 the Y; and
    21.4631188722804 the LRS measure.
    So, how do I get those X and Y as part of my query results? Thanks.
    Edited by: JG1981 on Jun 25, 2010 3:30 PM

    A bit of time has past... I got back to this piece of work again. Thanks for the tips above, I’ve successfully implemented some of those. It works, but it’s too slow for production.
    To summarise, this is the real world problem I’m dealing with:
    Let’s say I’ve got a table containing pedestrian’s footways; each footway is referenced to its road network section (link), many footways records to one section. I have to calculate the length of each individual footway along its road section.
    Theoretically this is done by projecting all the footway vertices onto its road section and returning the difference between the highest LRS value and the lowest. The problem is slightly made worse by the fact that each footway polygon can actually be made up of multiple elements (multipolygon).
    The following is a sort of high level logic. I’d like to know if any of you agree with this:
    1.     A temporary table t is created and populated with the following columns:
    a.     Footway_id  existing identifier;
    b.     Element_id  sequential and unique to the footway record;
    c.     Vertices  LRS point (projected point);
    2.     The table t is then queried: for each footway[sum[ each element (maxLRS-minLRS)]], in short, for each footway multipolygon the length of each element is added together to give the total length of the footway.
    Is this too clumsy? Is there another way to go about? Perhaps without the use of a temporary table? Any suggestion’s welcome.
    Thanks

  • Oracle Spatial - LRS component

    Hello,
    I am working as a consultant for a transportation department for building Highway Database Management system .Transportation department uses several Linear Referncing Methods such as Milepoint, Station, Refrence Marker etc to locate an attribute on a route . I am new to Oracle - LRS but have heared that by implementing Oracle-LRS , it can locate route attribute and events by one measure and not with x and y coordinate. Does anyone have implemented Oracle-LRS , if so I would like to know how can I design my dastabase based on LRS.
    What other problems Oracle LRS can solve in my case ?
    I will appreciate if some one can pass me design code etc to look into.
    Thank you.
    Suhail

    Thanks for your advice . I donot have 9i but hope to get very soon, I will give a shot then . One more thing which you mentioned in your previous answer is that one has to write extensive PL/SQL code to use LRS. In my case , I have a simple table of roads and would like to clip a segment of road dynamically and then based on the result I would like to fetch some data from other tables . But I lost here, because I donot have a way to relate data in the other table. I have a simple table say routes to store road geometry and in other route_features table I am storing road features ( attribute of the table is rc_id (pk),route_id_fk,feature_id_fk,feature_value,begin_milepoint,end_milepoint. Both tables are related with one key ie ROUTE_ID .I want to clip a segment of route from first table and then would like to get the data from the second table. I have no idea how I can accomplish this in PL/SQL. Here is my code what I am trying to do
    SQL> SELECT SDO_LRS.CLIP_GEOM_SEGMENT(route_geometry, 15, 30)
    2 FROM routes WHERE route_id = 1;
    SDO_LRS.CLIP_GEOM_SEGMENT(ROUTE_GEOMETRY,5,10)(SDO_GTYPE, SDO_SRID, SDO_POINT(X,
    SDO_GEOMETRY(3302, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 2, 1), SDO_ORDINATE_ARRAY(
    5, 4, 5, 8, 4, 8, 10, 4, 10))
    Now in the above result I have the output which is based on x,y,m . How I can use this to get feature_id_fk,feature_value data from teh second table? This is what you mentioned that requires lotof Pl/SQL programming. Could you share soem code here how to accomplis my task.
    I will appreciate your input.
    Thank you.
    Suhail

  • Does Report Builder 6i support Spatial Functions

    Does Report Builder 6i support spatial functions? I would like to use the following query in a report:
    SELECT id, rseq
    FROM gps a, user_sdo_geom_metadata m
    WHERE m.table_name = 'GPS'
    and mdsys.sdo_lrs.is_geom_segment_defined (a.geom, m.diminfo) = 'FALSE' and a.id like '01%'
    It does not recognize the spatial LRS function. This query does not return geometries but rather will only return tabular information.
    Thanks
    Dave

    Hello,
    Your colleague is right. Even if the SQL query is executed by the DB server , Reports needs to parse the SQL query.
    The SQL parser included in Reports 6i is based on 8.0.6
    You can see this version in the Reports Builder help :
    Menu : Help -> About Reports Builder ...
    ORACLE Server Release 8.0.6.0.0
    Regards

  • Is it possible to create a spatial index on a view?

    Hi
    Is it possible to create a spatial index on a view?
    We would like to link our spatial tables to each other (using only one of the SDO_GEOMETRY fields) in a view & make it very easy so that anybody can work with the data.
    Thanks Caroline.

    Simon,
    In order for autoregistration to work, you first need to make sure that all entries in mdsys.sdo_geom_metadata_table are registered with SDE. All tables not just one schema. None of our spatial tables or views exist in the SDE schema.
    Also make sure all Oracle Spatial tables in sde.table_registry are held in mdsys.sdo_geom_metadata_table.
    When a user makes a database connection in ArcCatalog, all Oracle Spatial tables will be registered with SDE automatically. Also, entries will be inserted into mdsys.sdo_geom_metadata_table and indexes will be created. If you do not have primary key fields, you will have to Register with Geodatabase and it will create the OBJECTID field.
    This did not work for us originally. but after cleaning up metadata and installing SP1, it is working now and it is very convenient.
    VIEWS:
    You have to create the view thru SDE. You cannot register foreign views. There are bugs in support of views containing SDO_GEOMETRY objects. I have been told some problems will be fixed in SP2 and there may be a patch out to address some others.
    Here are the incidents I have filed in reference to views:
    1.
    I created a view consisting of a geometry column from a "foreign" Oracle
    Spatial table (SDO_GEOMETRY) and corresponding attribution in another table.
    I used the following command to create the view through SDE:
    C:\arcgis\arcexe81\BIN>sdetable -o create_view -T gis_v_traffic -t
    "trims_traffi c_geom,traffic" -c
    "trims_traffic_geom.geometry,trims_traffic_geom.fid,traffic.i
    d_number,traffic.aadt" -w "trims_traffic_geom.mslink = traffic.mslink" -u
    gis -p spatial -i esri_sde -s JJ0DN10
    ArcSDE 8.1 Build 832 Thu Mar 22 14:08:07 PST 2001 Attribute Administration
    Utility ----------------------------------------------------- Successfully
    created view gis_v_traffic.
    I can preview the geometries in ArcCatalog without error.
    However, when I try to select a feature in ArcMap I get the following error:
    The instruction at "0x125222dd" referenced memory at "0x00000000". The
    memory could not be "read".
    I click ok.
    Then I get this error:
    The insruction at "0x5f8012d3" referenced memory at "0x00000004". the memory
    could not be "read".
    I click ok and ArcMap terminates.
    I can select features from the spatial table the view is pointing to, but
    not from the view itself.
    2.
    I need to create views utilizing database links to tie attribution in other
    databases to geometries created for that data in a spatial database.
    I issued the following command from command prompt and got this error:
    C:\arcgis\arcexe81\BIN>sdetable -o create_view -T link_v_traffic -t
    "trims_traff ic_geom,[email protected]" -c
    "trims_traffic_geom.geometry,trims_traffic_ge
    om.fid,[email protected],[email protected]" -w
    "trims_t raffic_geom.mslink = [email protected]" -u gis -p
    spatial -i esri_sd e -s JJ0DN10
    ArcSDE 8.1 Build 832 Thu Mar 22 14:08:07 PST 2001 Attribute Administration
    Utility ----------------------------------------------------- Error:
    Underlying DBMS error (-51). Error: Unable to create view link_v_traffic
    ORA-00957: duplicate column name (link_v_traffic)
    3.
    Spatial Views created on Oracle Spatial LRS layers containing SDO_GEOMETRY
    objects are not recognized as feature classes unless they are created with
    the sdetable -o create_view command.
    Here is typical SQL for the view creation:
    create or replace view trims_v_traffic as select a.geometry,
    b.nbr_tenn_cnty, b.nbr_rte, b.spcl_cse, b.cnty_seq, b.tr_beg_log_mle,
    b.tr_end_log_mle, b.yr_trfc, b.aadt, b.pct_peak_hr, b.dhv_pct, b.drct_distr,
    b.vhcl_pass_pickups, b.vhcl_su_trk, b.vhcl_mu_trk, b.actl_cnt, b.updt_by,
    b.updt_on, b.mslink, b.mapid, b.id_number, b.sta_nbr from
    gis.trims_traffic_geom a, gis.traffic b where a.mslink = b.mslink;
    The table containing the SDO_GEOMETRY object is registered with SDE in the
    following manner:
    C:\arcgis\arcexe81\BIN>sdelayer -o register -l trims_traffic_geom,geometry
    -e slM -k SDO_GEOME
    TRY -s JJ0DN10 -i esri_sde -u gis -p spatial -c fid -C SDE
    A feature class is successfully created for this layer and the data can be
    added successfully to a map.
    However, there is no way of adding data to a map from a spatial database
    view containing an SDO_GEOMETRY object which was created externally from
    SDE.
    We are using Oracle Spatial 8.1.7 on NT 4.0. We are also using ArcGIS 8.1
    and ArcSDE 8.1.1.
    4.
    SDE does not support spatial database views which reference snapshot
    objects.
    I was unable to create a view using sdetable -o create_view which referenced
    a snapshot object.
    The snapshot was created using the following sql syntax:
    CREATE SNAPSHOT SNP_TEST
    BUILD IMMEDIATE
    REFRESH FAST
    ON DEMAND
    AS
    SELECT * FROM [email protected]
    We are using ArcSDE 8.1.1 with Oracle 8.1.7 on NT 4.0.
    Here are the permissions I granted, they need to be the same for every schema:
    for sde (these are all the permissions that might be needed for any type of
    activity - new install or upgrade)..lets just step through and go ahead and
    grant them all...
    grant create session to sde;
    grant create table to sde;
    grant create procedure to sde;
    grant create sequence to sde;
    grant create trigger to sde;
    grant unlimited tablespace to sde;
    grant select any table to sde;
    grant create any sequence to sde;
    grant create any procedure to sde;
    grant execute any procedure to sde;
    grant drop any procedure to sde;
    grant select any sequence to sde;
    grant create any view to sde;
    grant drop any view to sde;
    grant create any trigger to sde;
    grant drop any sequence to sde;
    each Oracle user will also need the following privileges...
    grant create session to gis;
    grant create table to gis;
    grant create procedure to gis;
    grant create sequence to gis;
    grant create trigger to gis;
    grant unlimited tablespace to gis;
    Viewer
    The viewer is allowed to connect to an ArcSDE database. Other users grant
    select privileges on their tables and feature classes to the viewer or to
    the public role. The DBA can create a role that can be granted select
    privileges on data objects owned by other users. The role can be granted to
    the viewer.
    create session
    select on other user's data objects
    Editor
    The editor is allowed to connect to an ArcSDE database. Other users grant
    select and insert, update, or delete on data objects they own to editor. The
    DBA may create a role that can be granted select, insert, update, and delete
    privileges on data objects owned by other users. The role can be granted to
    the editor.
    create session
    select, insert, update, or delete on other user's data objects
    Creator
    The creator is allowed to connect to an ArcSDE database and create data
    objects. The creator may grant privileges on their
    objects to other users or roles. Other users can grant select and insert,
    update, or delete on data objects they own to creator. The DBA may create a
    role that can be granted select, insert, update, and delete privileges on
    data objects
    owned by other users. The role can be granted to the creator:
    create session
    create table
    create procedure
    create sequence
    create trigger
    unlimited tablespace
    select, insert, update, or delete on other user's objects
    It might be worthwhile to rebuild your SDE metadata. I can walk you thru that if you need help.
    Hope this helps.
    Dave
    null

  • Dynamic segmentation

    Hi,
    I am evaluating Oracle Spatial LRS model (10g) and I have a question on how I can implement a simple dynamic segmentation example. Certainly a straight forward function in a GIS environment but what about Oracle.
    For example, let’s assume that I have the following two tables:
    ROUTE table with (route_id, route_name, route_type,…, route_geometryMDSYS.SDO_GEOMETRY- x,y,M)
    LINE_ROUTE_FEATURES table with
    (route_id, attribute_type, start_milepoint, end_milepoint, …)
    What I want to do is dynamically place-“adjust” each record in the LINE_ROUTE_FEATURES in the corresponding route in the ROUTE table according to the start_milepoint, end_milepoint.
    When I say dynamically place-“adjust” I mean that I want to create a new line feature (view or table) by locating (for each record in the LINE_ROUTE_FEATURES), the correct route from the ROUTE table, the correct segment in the ROUTE table (if more than 1 segments exist for the specified route), the corresponding segment by clipping the previews route-segment according to the start/end mile point and finally placing the attribute type LINE_ROUTE_FEATURES in the newly created record. Anyway, something like this!
    Since I am not a programmer can somebody share with me a dynseq plsql example?
    The following sql works fine for a specific record.
    SELECT E.TYPE, E.TYPE_DESCRIPTION,
         SDO_LRS.CLIP_GEOM_SEGMENT(R.GEOM, E.KM_START, E.KM_END)
    FROM ROUTE R, LINE_ROUTE_FEATURES E
         WHERE R.ROUTE=E.ROUTE AND E.OBJECTID = 1 AND R.RIN=1;
    Thanks in advance and sorry for the confusion caused!

    So are you just trying to automate this based on the object_id (which might be some ascending numberic key) and r.rin of which there might be several for each object_id?
    Sorry, just trying to get a handle on the question.

  • "invalid LRS segment" when querying an Oracle Spatial DB

    I have a table of GIS segments in an Oracle Spatial database. I'm using C# and ODP to connect to the database. For a given measure from the start of a segment, I want to find the GPS coordinates for that point. I'm running the following query:
    select g.geom.sdo_ordinates ord_array from
    *(select sdo_lrs.locate_pt(shape,0.02,0) as geom from test_schema.test_table*
    where route='ABC' and segmentnum='101.1') g
    where shape is of type SDO_GEOMETRY. I'm getting the following error:
    ORA-13331: invalid LRS segment
    Is there a problem with how I'm passing shape to locate_pt()? The Oracle Spatial documentation says the argument should be SDO_geometry, so that seems ok.
    Edited by: 964844 on Oct 11, 2012 2:10 PM

    I'm using C# with ODP.NET.
    Here is the current version of the code that is failing:
    var param = new OracleParameter("geom", OracleDbType.Object);
    param.UdtTypeName = "MDSYS.SDO_GEOMETRY";
    param.Direction = ParameterDirection.Input;
    OracleCommand oCmd = new OracleCommand();
    oCmd.Connection = this.oConn;
    oCmd.CommandText = queryStr;
    oCmd.CommandType = CommandType.Text;
    oCmd.Parameters.Add(param);
    OracleDataAdapter da = new OracleDataAdapter(oCmd);
    DataTable dt = new DataTable();
    da.Fill(dt);
    The exception is generated by the da.Fill(dt) line.

  • LRS query functions / spatial indexing

    Could anyone tell me how functions that query geometric segments utilise spatial indexes? Am i right to assume, for example, that the SDO_LRS.CONNECTED_GEOM_SEGMENTS function makes use of similar algorithms to the SDO_RELATE operator? If so, how are performances comparable?
    Many thanks in advance
    Sam

    Hi,
    Did you check your geometry metadata and see if it has the right dimension information?
    select diminfo from user_sdo_geom_metadata where table_name = [your_geom_table_name] and column_name = [your_geom_column_name] ;you should have (x/lon,y/lat,m) for your 2D LRS (dim =3 ) geometry layer.
    And when creating the spatial index on your 2D LRS geometry layer, use the parameter 'SDO_INDX_DIMS=2' in your create spatial index statement.
    see 7.3 Indexing of LRS Data on 11gR1 manual: http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28400/sdo_lrs_concepts.htm#CIHJBDCA
    jack

  • Index on LRS returning error

    Hello
    We running some test on Oracle Spatial 8.1.7 on NT using LRS.
    After conversion our test dataset (roads) into LRS, we're trying to create an index
    on the geometry column.
    We're receiving the following error:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-22060: argument [2] is an invalid or uninitialized number
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD", line 8
    ORA-06512: at line 1
    I ran already through the similar issues in the forum so I already checked
    the SRID issues; Metadata issues: no problem here.
    We recently added the patch 571278 for bug 1575474.
    any idea what's causing this error?
    tx
    Luc

    We did found the problem after extensive search and testing...
    We used an sql statement for updating the metadatadefinition when we converted our dataset into an LRS.
    For the DIM_ELEMENT of the Measures we used:
    MDSYS.SDO_DIM_ELEMENT('M', NULL, NULL, NULL)
    This is apparently causing the errors.
    Although you have to exclude the M dimension when building the spatial index, the Upper and lower bounds may not have a NULL value.
    Luc

  • Questions on the LRS network model.

    On page 6-26 of the "Oracle Spatial Topology and Network Data Models" documentation, the example shows that measures are recorded in the 'roads' table (i.e. the one with the geometry of the feature).
    1. Why in this example is 'null' used for Node 5 ('...automatically calculated and filled...') but not the others?
    2. Why in this example is measure even necessary? There is no link to the underlying route from this table (i.e. measures should only be recorded in the context of a given route).
    3. It seems like this measure is merely the offset from the starting vertex (not true LRS); do we have the wrong interpretation?
    On Page 6-30, the example shows that measures are recorded for each Node and each Link. We had envisioned nodes and links being separate from the route they play a role upon. For example, if the same node was part of two distinct routes, does this mean storing two rows in "road_nodes"? But they're the exact same location and the same node in our network. The same question applies to the 'road_links' table. If the answer is 'duplicate the rows' in nodes and links (once per route), why doesn't 10g Spatial record 'measure' in the "road_paths" table? Note that, on page 6-31, it says that it is '...for possible future use...'...
    This example also implies the rows in the roads table are replicated as the (m)easure of the geometry column would change based on the route involved? If this is not the case why store the measure in the geometry column at all?

    Hi,
    My name is Gary Wong, and the original poster was asking these questions on my behalf. I'd like to continue the thread below in-line....
    A: This is a basic LRS concept. You can have some NULL
    measure values, and LRS can compute the actual measure
    corresponding to a NULL value. This has nothing to do
    with Network modeling, so you can assume a valid
    measure value here for this example.So this was just an example showing both 'manually calculated and entered' and 'let Spatial figure it out'? As this is merely the offset from the starting point, wouldn't a user always use NULL to let Spatial figure it out? It seems like this model will always use whole links in a contiguous fashion, so when would the measure not be the cumulative total?
    2. Why in this example is measure even necessary? There
    is no link to the underlying route from this table
    (i.e. measures should only be recorded in the context
    of a given route).So in this model (and example), the entry in roads is the route itself? Other LRS models allow the re-use of a common route, so multiple entries in the roads table would reference the same route (in another table). A real-life example is a single straight road that has different names, or has different road surface, or road classifications.
    Folowing this example, if I wanted to spatially reference some other business attribution on an existing route, say R1, would I have to create another entry in roads and duplicate the data? Even if it has the same start/end locations and path?
    A: Measure is always an offset from the start vertex
    and this is true for any LRS system. I am not sure what
    you mean by "not true LRS".My mistake in using these words; there is no true LRS, just different models/implementations of it =8^). Other LRS systems can have a measure beginning, say 2.5 metres after the starting node (node, not vertex; I define a vertex as as one of co-ordinates defining the link, and node as a topologically significant vertex such as the start and end vertices).
    Hmmm, does this answer my first question above? If you wished to start a road (as per the example) slightly off of a node, would you enter a non-zero measure as the initial co-ordinate?
    Assuming I'm on the right track (i.e. cannot re-use a route), does anyone know if Oracle plans to implement this kind of LRS in 10g Spatial?
    I see a cryptic ".. for possible future use..." reference on page 6-31 regarding the create_path_table() and create_path_link_table() methods.
    Is this future use to allow multiple uses and references of a route?
    Thanks and sorry for the loooong email..
    gary

  • Has anyone tried to extend Spatial with a 3D primitive?

    Has anyone tried to extend Spatial with a 3D primitive that for example can model buildings and tunnels? I am trying to add the polyhedron primitive next to the existing point, line, polygon model. I just want to hear some tips or ideas...

    The plan is to make a new GType and new stored functions that recognize this GType.
    A polyhedron could be of type 3008,3D and 8=polyhedron(=new). The elem_info
    and ordinates contain multiple planes. Self-created stored functions would be
    able to recognize this GType, e.g. area3D should give the sum of the areas of all the
    faces of the polyhedron and should also work on Gtype=3003 and give the real area
    of a 3D polygon instead of the projection.I wouldn't suggest this methodology if you are considering using any spatial indexing or
    functions with your data.
    There is a mechanism Oracle Spatial has for defining custom datatypes. It should only
    be used with custom apps, i.e. it won't be usable in the context of applications that know
    about Oracle Spatial data types.
    The mechanism allows you to define you own element using an element type of 0, and using
    the interpretation to define what you are looking at. You would also include an a supported
    element type that approximates your geometry, and that element is the one that is indexed,
    and the gtype entered is associated with that geometry. Your private functions could access
    the 3d geometry when required. For instance, you want to have a 3d cube. It might look like this:
    sdo_gtype=3002
    sdo_elem_info=(1,2,1, 7,0,1, 22,0,2 etc.
    sdo_ordinates=(0,0,0,2,2,2, 0,0,0,2,0,0,2,2,0,0,2,0,0,0,0, 2,0,0,2,0,2,2,2,2,2,2,0,2,0,0, etc
    the 1,2,1 in the elem info array corresponds to a 3d line string that when indexed with a minimum bounding
    volume encloses the 3d cube. The 0,0,0 and 2,2,2 in the ordinate array stored as the line string when indexed
    include the bounds of the cube. Next in the elem info array are 7,0,1. The 7 means offst 7 in the ordinate array
    and in this example is fixed. Next the 0 tells Oracle Spatial to ignore this element. The interpretation of 1 you define,
    the number could be anything. Since it is my example, I'll say the 1 means this is the definition of the first face in the
    x,y plane (i.e. the front face of the cube which faces me). I've set the ordinate array with the coordinates of that face.
    Next in elem info comes 22,0,2 which is starting at offset 22 there is another element that Oracle spatial should ignore
    (element type 0), and next comes 2, which might mean this is the second face definition, that I've defined as the right
    hand side y,z plane.
    etc.
    The meaning of the interpretation value is only limited by your imagination.
    Note while you can index three dimensions if you want, the only spatial functionality that supports 3d is a spatial
    index and a filter query, and some lrs functions. You will not be able to run any operator except for SDO_FILTER if you
    have a 3d index, and all spatial functions will only work on 2d.
    Do not define your own gtype and expect to use spatial. it will not work.

  • Spatial functionality in a Java client?

    Background:
    We've been a big supporter and user of Oracle Spatial with our CVC application since 2005. The enterprise model we adopted and have been using consists of a Java Web-Start desktop client editor application, Java middle tier application (basically a data marshaller), and Oracle Enterprise with Spatial on the back end. Most of the spatial processing, consisting of object creation and editing occurs on the back-end in PL/SQL packages calling various spatial functions and operators, and returning new or revised shapes and other data to the client for caching and display.
    This model has worked quite well for the 300 or so sites that concurrently edit against a single enterprise-wide dataset. But - the network is degrading. Our working premise when we set out in 2005 was the network would increase in bandwidth and decrease in latency and errors. The opposite is true. We were also mislead in that WiFi (or then WiMax) would be greatly supported for out-of-office but still connected to the network usage. This also has not happened. So we need to re-think the architecture to be more client-centric.
    The future:
    What I need to be able to do is move most of the spatial processing and business logic out of the back-end database, and into the JWS client. BUT - that presents a real problem. So far, I have been unable to locate good commercial or FOSS java spatial libraries that come close to replicating what we now use with Oracle spatial - such as:
    Basic spatial logic functions (covers, inside, etc) - generally met by most libraries
    Geographic dataset storage with indexes that can cross boundaries (EPSG:4326 for us) - none I know of, although JASPA might do this in the near future with H2.
    Geodetic calculations for distance - none I know of
    LRS type functions for pt at bearing, distance along a line, pt on a line - none I know of
    ORACLE CORP - Listen Up:
    What I'd like to have are the Java spatial functions currently embedded in the enterprise db - licensed as a deployable set of jars with a Java-based database that a client can utilize locally or even "offline". Essentially a new product with a lot of shared (already developed) code. Perhaps combine this with Berkeley DB Java Edition. Seems like an easy win/win for Oracle and users to me.
    However... with all the crazy "cloud is it" mentality lately, I'm not sure that will fly. Somehow, I think we will end up rolling our own, possibly extending the JASPA libraries to do all these extra functions on H2. Should work, but much more work that should be required.
    Thoughts? Suggestions?
    Thanks... Bryan

    Which piece of code is throwing error phaos or jsse ?

  • Urgent - Please help me on Linera Refrencing System-LRS

    Oracle Spatial - Linear Referencing System (LRS)question
    We are building a Highway Database management system and would like to implement Oracle Spatial- Linear Refrencing System-LRS . I have found some example at http://technet.oracle.com/docs/products/oracle8i/doc_library/817_doc/inter.817/a85337/sdo_lrsa.htm#884429 . In this example Oracle has used coordinats ie x and y . I know that major advantage of using LRS is its capability of locating attributes and events along a linear feature with only one parameter (usually known as measure) instead of two (such as latitude/longitude or x/y in Cartesian space). How can I use one parameter and in my case it is MEASURE (mile point) like 10, 20, 40, etc to build my route geometry in this situation. I tried to do following in my route table but when I tried to validate the route , it gave me error- FALSE.
    Here is my insert statement in route table lrs_routes with column route_id, route_name and route_geometry of the type MDSYS.SDO_GEOMETRY.
    INSERT INTO lrs_routes VALUES(
    3,
    'Route-3',
    MDSYS.SDO_GEOMETRY(
    3001,
    NULL,
    NULL,
    MDSYS.SDO_ELEM_INFO_ARRAY(1,2,1),
    MDSYS.SDO_ORDINATE_ARRAY(
    0,
    1.57,
    1.62,
    2.7,
    7.5,
    8.9,
    53.6,
    55.4,
    57.6,
    60.2,
    70.99,
    71.54,
    73.97,
    77.21,
    83.56,
    89.59,
    91.29
    I will appreciate your input.
    Thank you.
    Syed

    Dave,
    I am using 8i - 8.17. Thanks for the update. One more question I would like to ask, do you have any background of designing a spatial Database? I am responsible to design our Route System using LRS and as you know each route at one mile point may have several featuers such as 'payment Type', 'Payment width', 'Median type', 'Posted Speed limit' etc . One mile point may have upto 90 features in my case. I am planning to create two tables one to hold just route name, route type and the geometry , something similar to following
    s_routes tables
    (route_id number,
    route_name varchar2(40),
    route_type varchar2(5), -- HiGHWAY or LOCAL
    route_geometry MDSYS.SDO_GEOMETRY)
    second table will hold all the features of the route
    s_route_features
    (route_id number, - -Foreigh key from s_routes
    rf_id number, -- route feature id , primary key concate with route_id
    attribute_name varchar2(50), -- Payment type, median width etc
    begin_milepoint number,
    end_milepoint number,
    utm_x number,
    utm_y number
    I am storing my route geometry in the first table and all the featuers/attributes in the second table.
    Second table can hold upto 5000 records for one route only , because for each milepoint there can be several route attributes and theer can be several begin mile point
    My question is , lets say the length of a route is 180 miles and I want to divide this route into two at some point say at 75 , so how can I divide one route into two routes and at the same time I would like to divide my route features in the s_route_features . In other words route one will hold feature upto 75 miles and second route will hold features starting from 76 to 180 miles and the length of the second route will be 105 ( 180 minus 75) .
    Let me know if it make sence to you.
    Thanks
    Syed
    Syed

  • 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

  • Oracle10g Spatial - Some information

    Hi,
    Some of the talks at Oracle World this week will discuss publicly for the first time some of the new features in Spatial for Oracle10g. There has been some interest expressed in this forum in finding out what to expect, so some information has been put together specifically to post here.
    A brief list of major features include:
    Topology Data Model - The ability to store and maintain spatial data in a topologically consistent way using nodes, edges, and faces. The topology model is a persistent (stored) model. Java and PL/SQL APIs are provided for applications/users who want to update topology data. The ability to select spatial features from the topological primitives is supported, as is the ability to store spatial features in a separate geometry column.
    Network Data Model - The ability to store and maintain connectivity (graph) information in the database. The network data model includes a routing engine, and it can be integrated with spatial data, linear referenced spatial data, or topology data. Cost information can be stored and accounted for when doing network analysis.
    GeoRaster - The ability to store, index, and retrieve Raster data (image, grid, raster, you name it) using the Oracle 10g database. Oracle Spatial GeoRaster includes an xml metadata schema for GeoRaster metadata. GeoRaster supports georeferenced data so you can dynamically determine which pixels/cells to fetch from an image based on a set of Earth coordinates and determine Earth coordinates based on pieces of an image. It also includes the ability to publish GeoRaster data as GIFF or JPEG images.
    GeoCoding - New function to generate long/lat from Address data.
    Spatial data mining features for use in demographics, epidemiology, insurance, business analysis, etc.
    New, supported Java API (ships with Spatial). Includes in-memory R-tree indexing.
    In the Application server associated with 10g, a faster and improved version of MapViewer.
    A short (incomplete) list of other new features include:
    Transportable tablespace support for tables with Spatial indexes.
    Generate the location of a point given a start point and bearing.
    Generate GML (geography markup language) from spatial data.
    SDO_JOIN feature to optimally combine two layers based on spatial interactions.
    Default for SDO_RELATE and SDO_FILTER is now querytype=window, which no longer needs to be specified.
    New operators for specific interactions, such as SDO_INSIDE and SDO_ANYINTERACT.
    New function to validate WKTEXT of user-defined coordinate systems.
    MBR type is now supported for geodetic data (internally densifies every degree of latitude).
    LRS enhancements to include signed offset for some functions.
    New function to estimate the R-tree index size before it is created.
    Interior buffers (negative buffer distance).
    ...and many others.
    Thanks for using spatial, and hopefully the new features will help with current development as well as give ideas for future work using spatial.

    I got some info at https://www.oracleworld2003.com/published/40125/40125_Lopez.doc and at
    https://www.oracleworld2003.com/published/40125/40125_Lopez_v3.ppt
    However, I would like to know some details about nw functions, model etc.
    Thanks
    Syed

Maybe you are looking for