14 Replies Latest reply: Aug 22, 2014 3:00 PM by 2716322 RSS

    Objects representation displacement

    2716322

      Hi, everyone. I need some advice. Whenever I load polygons, they match the layout of the map. But with points (or objects with only one "X" and one "Y"), they are always displaced for a few meters (I think around 50).

      I tested with Google Maps, Nokia Maps (here), and OSM. So I'm guessing the issue is not with the maps.

      Also, I loaded the information from the tables with another program and it's showing them correctly organized, therefore, it's not a DB issue or how they were set up.

      I tried changing the SRID, but nothing. Not sure what else to do.

      I'll try to attach a screenshot to be more clear about my issue.

       

       

      Mapbuilder:

      Version: 11.1.1.7.2

      Build: Ver11_1_1_7_2_B131022

       

       

      Mapviewer 11G

       

       

      [URL=http://imageshack.us/photo/my-images/904/854705.png/][IMG]http://img904.imageshack.us/img904/8307/854705.png[/IMG][/URL]

       

       

      Uploaded with [URL=http://imageshack.us]ImageShack.us[/URL]

       

       

       

       

      Thanks in advance!

        • 1. Re: Objects representation displacement
          Renan Barbalho

          Hi,

           

          Can you post your HTML and Javascript code?

           

          Regards,

           

          Renan

          • 2. Re: Re: Objects representation displacement
            2716322

            Hi, Renan. Thanks for your help.

            Not sure where to get the Javascript code ( I was looking for it earlier for some other stuff). If you know the default name or whereabouts, I'd appreciate the help.

            Here's the HTML code:

            <!-- <!-- ***********************************************************  -->

            <!-- This page is automatically generated by Oracle Map Builder.  -->

            <!-- It is based on a template file (appbuilder_template.html)    -->

            <!-- with a simple Oracle Maps Application.                       -->

            <!-- The application can have the following elements:             -->

            <!--     Left Side: FOI theme list with visibility option,        -->

            <!--                and legend items with styles.                 -->

            <!--     Right Side: map with navigation panel, scale bar,        -->

            <!--                 copyright note and overview map.             -->

            <!--                                                              -->

            <!-- All strings on the template file enclosed by character # are -->

            <!-- replaced with values defined in MapBuilder wizard.           -->

            <!-- To start the Application Builder wizard in MapBuilder        -->

            <!-- select the tile layer node on the Metadata tree, and right   -->

            <!-- click the mouse to access the menu option to create the      -->

            <!-- application. At the end of the wizard, a HTML file will be   -->

            <!-- saved on the specified directory.                            -->

            <!-- ***********************************************************  -->

             

             

            <!-- <html> -->

            <!-- <head> -->

            <!-- <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> -->

             

             

            <!-- ***********************************************************  -->

            <!-- Define the page title                                        -->

            <!-- ***********************************************************  -->

             

             

            <!-- <TITLE> Oracle Maps Application </TITLE> -->

             

             

            <!-- ***********************************************************  -->

            <!-- Define the location of Oracle Maps API. Something like:      -->

            <!--  http://localhost:7001/mapviewer/fsmc/jslib/oraclemaps.js    -->

            <!-- ***********************************************************  -->

             

             

            <!-- <script language="Javascript" src="http://localhost:7001/mapviewer/fsmc/jslib/oraclemaps.js"></script> -->

             

             

            <!-- <script language=javascript> -->

              <!-- var mapview; -->

              <!-- var scaleBar; -->

              <!-- var ovcontainer; -->

            <!--  -->

              <!-- function showMap() -->

              {

             

             

            /********************************************************************

            *   Define the basic parameters for the function to display the map.*

            *   These parameters include the MapViewer server location,         *

            *   the MapViewer data source, the tile layer name, and             *

            *   the start map center location with the specified zoom level and *

            *   its SRID.                                                       *

            ********************************************************************/

             

                <!-- var baseURL  = "http://localhost:7001/mapviewer"; -->

                <!-- var mapCenterLon = 0.0; -->

                <!-- var mapCenterLat =  0.0; -->

                <!-- var mapZoom      =  2;   -->

                <!-- var mpoint = MVSdoGeometry.createPoint(mapCenterLon,mapCenterLat,3857); -->

                <!-- mapview = new MVMapView(document.getElementById("map"), baseURL); -->

                <!-- mapview.addMapTileLayer(new MVMapTileLayer("exampleDB.NOKIA_MAP"));  -->

                <!-- mapview.setCenter(mpoint);  -->

                <!-- mapview.setZoomLevel(mapZoom);  -->

             

             

            /********************************************************************

            *   Define the navigation panel position on the map area:           *

            *      (EAST,WEST)                                                  *

            ********************************************************************/

             

             

                <!-- mapview.addNavigationPanel('EAST'); -->

             

             

            /********************************************************************

            *   Function to add FOI themes to the map.                          *

            *   FOI themes contain features that you can interact on your       *

            *   application.                                                    *

            ********************************************************************/

             

             

                <!-- addThemeBasedFOI(); -->

              

            /********************************************************************

            *    Add a Scale bar on the bottom left corner of the map           *

            ********************************************************************/

             

             

                <!-- scaleBar = new MVMapDecoration(new MVScaleBar(),0, 1, null, null, 4, -45);  -->

                <!-- mapview.addMapDecoration(scaleBar); -->

              

            /********************************************************************

            *    Add a collapsible Overview Map on the right corner of the map  *

            ********************************************************************/

              

                <!-- ovcontainer = new MVMapDecoration(new MVOverviewMap(4),null,null,200,150); -->

                <!-- ovcontainer.setCollapsible(true, true); -->

                <!-- ovcontainer.setTitleBar("<font face='Tahoma' size='2'>Overview Map</font>", "http://localhost:7001/mapviewer/fsmc/images/overviewicon.gif", "Overview map"); -->

                <!-- mapview.addMapDecoration(ovcontainer); -->

              

            /********************************************************************

            *    Add a toolbar.                                                   *

            ********************************************************************/

             

             

                <!-- addToolBar(); -->

             

             

            /********************************************************************

            *    Display map.                                                   *

            ********************************************************************/

             

             

            <!--      -->mapview.display();

              }

             

             

            /********************************************************************

            *    Function to add a tool bar with zoom and measure tools         *

            ********************************************************************/

            <!--  function addToolBar()

            {

               // Create a tool bar that shows all builtin tool buttons.

            <!--    toolbar = new MVToolBar("toolbar1",[MVToolBar.BUILTIN_MARQUEE_ZOOM,MVToolBar.BUILTIN_DISTANCE]);

                toolbar.setPosition(0.04,0.04); -->

                <!-- mapview.addToolBar(toolbar);  -->

             

            <!-- var distanceTool = toolbar.getBuiltInTool(MVToolBar.BUILTIN_DISTANCE) ; -->

               <!-- distanceTool.setRenderingStyle(MVRedlineTool.STYLE_LINE,"exampleDB.L.PTH");   -->

             

             

            /********************************************************************

            *    Function to add FOI themes to your map. One or more themes     *

            *    may be added, and in this case the couple of lines in this     *

            *    function should be repeated with different indexes.            *

            *    MapBuilder wizard also allows to choose some levels for each   *

            *    FOI theme in order to reduce the ammount of data at the        *

            *    client side. For each theme the following calls may be added.  *

            *       setMinVisibleZoomLevel: minimum visibility level            *

            *       setMaxVisibleZoomLevel: maximum visibility level            *

            *       setMinClickableZoomLevel: level from which features are     *

            *                                 clickable                         *

            *       setMaxWholeImageLevel: maximum level that the FOI theme     *

            *                              is rendered as an image              *

            ********************************************************************/

             

             

            <!--   function addThemeBasedFOI()

            <!--   {

               <!--  var themebasedfoi1 = new MVThemeBasedFOI('themebasedfoi1','exampleDB.Markings');

               <!--  mapview.addThemeBasedFOI(themebasedfoi1); -->

                <!-- themebasedfoi1.setMinVisibleZoomLevel(16); -->

                <!-- themebasedfoi1.setMinClickableZoomLevel(16); -->

            <!--     themebasedfoi1.setMaxWholeImageLevel(8); --> -->

               } -->

             

             

             

            /********************************************************************

            *    Function to control visibility of themes (check box clicks)    *

            ********************************************************************/

              -->

            <!--   function setVisible(item)

              {

               <!--  var themebasedfoi = mapview.getThemeBasedFOI(item.value);      -->

                <!-- themebasedfoi.setVisible(!themebasedfoi.isVisible()); -->

              }

             

             

            <!-- </script> -->

              

            <!-- </head> -->

             

             

            <!-- ***********************************************************  -->

            <!--  Call showMap function when loading the page                 -->

            <!-- ***********************************************************  -->

             

             

            <!-- <body onload=javascript:showMap();> -->

             

             

            <!-- ***********************************************************  -->

            <!-- Define the page header                                       -->

            <!-- ***********************************************************  -->

             

             

              <!-- <h3> Oracle Maps Sample Application </h3> -->

             

             

             

             

             

             

            <!--   <table cellspacing="2" cellpadding="3" border="1" width="100%" height="500">

               <tr>

                <td width="20%">

                  <form>

                    <font face="Arial,Helvetica" size="3"><b>Themes</b></font>

                    <br/>

                  <INPUT TYPE="checkbox" value="themebasedfoi1" onclick="setVisible(this)" checked/>Markings

                 </form>

                </td>

                <td width="80%">

                  <div id="map" style="left:0px; top:0px; width:100%; height:100%"></div>

                </td>

               </tr>

              </table>

             

            </body>

            </html> --> -->

             

             

             

             

             

             

            Let me know if there's anything else I could provide.

            Thanks in advance!

             

             

            EDIT: the code without commented blocks would execute, so I had to comment everything. It looks awful, here you can see the code as it is: CodePaste.NET - W/O additional comments

            • 3. Re: Objects representation displacement
              Renan Barbalho

              Hi guy,

              Can you see the polygons on Mapbuilder?

              Can you post the theme and style definition that you are using?

              How was defined geometry type on database? (2001,2002 or 2003)?

               

              Regards,

              Renan

              • 4. Re: Re: Objects representation displacement
                2716322

                Hi, Renan. Here are my answers, as limited as they may be (sorry).

                 

                Can you see the polygons on Mapbuilder? -- Yes, and also in mapviewer. The difference is that in mapviewer I can see the Google/Nokia Map to find there's a displacement. In Map builder there's no map in the background.

                Can you post the theme and style definition that you are using? --Not sure what you mean, will post the theme's builder's xml at the bottom.

                How was defined geometry type on database? (2001,2002 or 2003)? ---The Geometry is 2001 (at least this object)

                 

                Also, I'd like to point out something, and correct my initial statement where I said that polygons where correct. They are also displaced and depending on which map I'm projecting, the mismatch grows between the source information and what I obtain. Here's an image showing how data is represented on both Nokia maps and Google Maps. For some reason I can't quite figure out yet, they are also showing different data from eachother.

                 

                displacement - example

                 

                 

                THEME XML:

                <?xml version="1.0" standalone="yes"?>

                <styling_rules>

                    <hidden_info>

                        <field column="OBJECTID" name="OBJECTID"/>

                        <field column="LOCALIDAD_GEO" name="Localidad_Geo"/>

                  </hidden_info>

                    <rule>

                        <features style="MDSYS:M.PENTAGON"> </features>

                  </rule>

                </styling_rules>

                 

                 

                Thanks again!

                 

                EDIT: Just FYI: there are pentagons in the image, but they are a single point (x, y only). Just like in the first image I posted, but different entity.

                • 5. Re: Objects representation displacement
                  Renan Barbalho

                  If I understood your problem is displacement of the points. That's it?

                  What is the original SRID of your data?

                   

                   

                  Can you send me a part of data (few records of the table) to build a test?

                   

                   

                  What is Oracle DataBase version?

                   

                   

                  Regards,

                  Renan

                  • 6. Re: Re: Objects representation displacement
                    2716322

                    Let's see if this is everything you need:

                     

                     

                    That's it? --I think so!

                     

                    What is the original SRID of your data? --3.857

                     

                    What is Oracle DataBase version? --Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

                     

                     

                     

                     

                    Can you send me a part of data (few records of the table) to build a test? --Not sure how, let me know if this is not enough, I'll try to talk to someone. These 3 entities here are those represented in the maps:

                     

                    Table: EW_BOX

                     

                     

                    OBJECT     RUNTM       GEOM                                                                    TYPE

                    6240524       22            (2001;22195;(5637699,578454; 617664,863613;); ; )     BO

                    6240613       22            (2001;22195;(5637670,145381; 6176648,761996;); ; )   BO

                    6240677       22            (2001;22195;(5637654,48301; 6176640,193761;); ; )     BO

                     

                     

                    The GEOM field has concatenated data inside, being:

                     

                    SDO_GTYPE; SDO_SRID; SDO_POINT(X); SDO_POINT(Y)

                     

                    Regards!

                    • 7. Re: Objects representation displacement
                      Renan Barbalho

                      points.png

                      2716322 Are these your points? I don't know the real position of them.

                      I put your data in my oracle database and I'm showing in nokia maps.

                      • 8. Re: Re: Objects representation displacement
                        2716322

                        OMG, yes!! Those are 2 out of the 3 you can see in the image:

                         

                        http://www.subirimagenes.net/i/140721085941288108.png

                         

                        How did you do that? Now I'm wondering if there's anything wrong with how I set up my mapviewer or anything wrong elsewhere...

                         

                        Since you obviously have it right, is there anything you think I could have set up wrong?

                        • 9. Re: Re: Re: Objects representation displacement
                          Renan Barbalho

                          First I don't know if you did anything wrong. I'll pass all steps that I did to configure the data and the map.

                           

                          Put data in database:

                           

                          1 - create spatial table:

                           

                          create table EW_BOX
                          (
                            OBJECTID NUMBER,
                            RUNTM    NUMBER,
                            TYPE    VARCHAR2(10),
                            GEOM    MDSYS.SDO_GEOMETRY
                          )
                          

                           

                          2 - insert values this way:

                           

                          INSERT INTO EW_BOX 
                          VALUES (6240524, 22, 'BO', SDO_GEOMETRY(2001, 22195, SDO_POINT_TYPE(5637699.578454, 617664.863613, NULL), NULL, NULL));
                          
                          
                          INSERT INTO EW_BOX 
                          VALUES (6240613, 22, 'BO', SDO_GEOMETRY(2001, 22195, SDO_POINT_TYPE(5637670.145381, 6176648.761996, NULL), NULL, NULL));
                          
                          
                          INSERT INTO EW_BOX 
                          VALUES (6240677, 22, 'BO', SDO_GEOMETRY(2001, 22195, SDO_POINT_TYPE(5637654.48301, 6176640.193761, NULL), NULL, NULL));
                          

                           

                          3 - configure table in spatial view (user_sdo_geom_metadata):

                           

                          INSERT INTO USER_SDO_GEOM_METADATA (TABLE_NAME, COLUMN_NAME, DIMINFO, SRID)
                          VALUES ('EW_BOX', 'GEOM', SDO_DIM_ARRAY(SDO_DIM_ELEMENT('X',-180,180,0.005),SDO_DIM_ELEMENT('Y',-90,90,0.005)), 22195);
                          

                           

                          4 - create spatial index:

                           

                          CREATE INDEX EW_BOX_SDX ON EW_BOX(GEOM) INDEXTYPE IS MDSYS.SPATIAL_INDEX
                          

                           

                          After I put the data in database I created the theme in the mapbuilder.

                           

                          theme.png

                           

                          View the theme on the map:

                           

                          I used the OracleMaps V2 to view the data on the map because the new version of Oraclemaps is better than older version.

                          I had the same problem of the displacement when I used the Google TileLayer in mode Road or Vectorial when I turned to the satellite map the points has been shown perfectly.

                          You should try to use OracleMapV2, see sample B03 and B04.

                           

                           

                          Maybe you can pass the logging messages and config file of mapviewer to try find a possible error.

                          • 10. Re: Re: Objects representation displacement
                            2716322

                            Wow, thanks for that! Couldn't have been any more clear!

                            So I did that, and for some reason, I'm not getting what you got, still the same as before, even with this new table. Logs seem fine since there are no errors or anything, just says "loading" this and loading that. Have 2 questions:

                            1) I saw something about "DPI". Could that be a reason for the displacement?

                            2) Maybe my difference lies within the setup of the Map Tile and not in the data itself or the theme. That's all that's left after I did all you said I think.

                            Here's the information on my tile.

                             

                            http://www.subirimagenes.net/i/140722034857288602.png

                             

                            Best Regards!

                            • 11. Re: Objects representation displacement
                              Renan Barbalho

                              Why you not try to use Oraclemaps V2?

                              Did you try to create this tile map by javascript api? sometimes the problem is on tile map generated by mapviewer.

                              Like demos:

                              Built-in Google Maps tile Layer (http://<YOUR_SERVER_AND_PORT>/mvdemo/fsmc/tutorial/samples/googleMapTileLayer.html)

                              Built-in Nokia Maps tile Layer (http://<YOUR_SERVER_AND_PORT>/mvdemo/fsmc/tutorial/samples/nokiaMapTileLayer.html)

                              Built-in Bing Maps tile Layer (http://<YOUR_SERVER_AND_PORT>/mvdemo/fsmc/tutorial/samples/bingMapTileLayer.html)

                              • 12. Re: Re: Objects representation displacement
                                2716322

                                I'm not being able to replace the data as it's needed for V2. I'm trying, but not getting it.

                                I took a look at the built-in tiles, but since I couldn't even get the mvdemo to work before, I also can't now.

                                I'll keep testing it.

                                 

                                Regarding your question, I create the map tiles through the mapviewer local site with the ADMIN user, not via mapbuilder since I can't get it to work there.

                                 

                                Thanks Renan, I'll comment on any updates for future references (if any).

                                • 13. Re: Re: Objects representation displacement
                                  2716322

                                  First of all, thanks Renan for your support. Really appreciate it.

                                  For anyone who may come accros this post, sorry, there's no answer here, maybe Renan's answer might be of help though.

                                  I'm going to follow the long line of desk flippers in this forum and dismiss this product. I have to move on to other software which I might add, has way better support and DOCUMENTATION so far.

                                  Again, thanks Renan for your time, and to Oracle people... work to improve your documentation and support, this forum and whatever little documentation I was able to find online was poor and lacked consistency between different versions. One customer at a time...

                                  • 14. Re: Re: Objects representation displacement
                                    2716322

                                    Go F*c-.k yourself, Oracle.