Spectrum Spatial (SSA/LIM)

Expand all | Collapse all

Order of results in information pane

Jump to Best Answer
  • 1.  Order of results in information pane

    Posted 01-06-2020 04:52
    I have a tab file layer displayed in SSA where some of the polygons are overlapping. So in some places clicking on the map brings back just one result but in others three might be returned. Where there are multiple results there doesn't seem to be any logical order to the way the data is displayed in the information pane eg it's not alphabetical. Is there a way to set the order that results are displayed here? I have had a request to show a particular school catchment area at the top of the list when there are multiple results but can't find a way to do this.



    ------------------------------
    Chris Dickinson
    North Yorkshire County Council
    ------------------------------


  • 2.  RE: Order of results in information pane

    Posted 01-06-2020 08:11
    Chris,

    Can you check the polygon order in the original MapInfo table in Pro.  If it is the same as displayed in SS you could try editing the required polygon slightly (e.g. add node and then remove node) and that 'should' move that polygon to the top.

    I haven't tried this though and I'm not 100% sure the polygon order is the same in SS as it is in Pro,

    HTH

    Nick

    ------------------------------
    Nick Hall
    Mapchester LTD
    nick.hall@mapchester.co.uk
    ------------------------------



  • 3.  RE: Order of results in information pane
    Best Answer

    Employee
    Posted 01-06-2020 08:25
    Nick and Chris,
    There is no way to control the order of overlapping spatial objects in either MapInfo Pro or Spectrum Spatial (the Analyst application is not even part of the issue) without a query. Spatial index storage does not have this capability.
    However, in MapInfo Pro, when you edit geometries, the results are stored temporarily in a transaction file. This allows you to revert your changes and forces you to commit them if that is what you want.
    While that transaction file is in use in MapInfo Pro, the edited geometries will be rendered last, I believe, giving you the visual impression that they are now on top. But this is only temporary. Once the table is saved, the spatial index will be reintegrated and the order will then become non-deterministic of any attributes once again.
    However, if you create a query table in Spatial Manager and make sure your layer is pointing to it, that query will be applied and that will affect the order of what is returned and what is drawn on the map. Depending on the query, of course, performance can also be affected. I would suggest indexing the column or columns involved in the query.

    ------------------------------
    Eric Blasenheim
    Spectrum Spatial Technical Product Manager
    Troy, NY
    ------------------------------



  • 4.  RE: Order of results in information pane

    Posted 01-06-2020 10:23
    Thanks guys

    ------------------------------
    Chris Dickinson
    North Yorkshire County Council
    ------------------------------



  • 5.  RE: Order of results in information pane

    Posted 01-07-2020 04:15

    Hi Chris,

     

    I'm just thinking out loud here, but if you a) re-order the data in Mapinfo, and then b) work out a way of perma-saving that reordering in the .tab file, then would that make difference to the order in which results return in SSA?

     

    Regards,

     

     

     

    Stuart Carter

    Corporate GIS Manager

     

    Southwark Council

    2nd floor, zone B

    160 Tooley Street

    London, SE1 2QH

    Tel: (0207 52) 55409

    stuart.carter@southwark.gov.uk

     

    Southwark Maps - public facing mapping service

    In My Area

    Old maps

     

     

     

     

     

     

     

     

     

     

     






  • 6.  RE: Order of results in information pane

    Posted 01-07-2020 09:38
    Hi Stuart
    The spatial indexing is such that objects are retrieved and displayed in the most efficient way that they can be re-ordered with every zoom and pan!

    ------------------------------
    John Ievers
    CDR Group
    Hope Valley, United Kingdom
    ------------------------------



  • 7.  RE: Order of results in information pane

    Posted 01-07-2020 12:09

    Hi Chris,

     

    I think I have the/a solution for you.

     

    Open the tab file in Mapinfo and run an SQL Query by ordering by the field of your choice (the one that's not in alphabetical order). Save the resulting query as anew .tab. If you then publish that .tab file and view in SSA and click at any location where there are overlapping features the  result in left side panel will be in alphabetical order.

     

    I've set up an example at https://geo.southwark.gov.uk/connect/analyst/mobile/#/main?mapcfg=Order%20test.

     

    Turn on the not_in_order layer leaving in_order switched off. Now single click at 532963, 175463 and see how the results are ordered in left side panel: g, y, p, e, j

     

    Now turn on the in_order layer leaving not_in_order switched off. Single click at 532963, 175463 and see how the results are ordered in left side panel: e, g, j, p, y

     

     

    Regards,

    Stuart

     

     

     

     

     






  • 8.  RE: Order of results in information pane

    Employee
    Posted 01-07-2020 17:37
    Stuart, I took a peek at your site and I do believe you are just getting lucky.
    By ordering the objects via SQL and then saving them, they will each get inserted into the R-tree (of the .map file, the index) in that order and that may correspond, depending on the size and number of objects (an rtree is somewhat balanced) to the original order but there is no guarantee especially if the table is edited again, packed or anything else that could redo the r-tree.  ​
    You can see, using the Chrome debugger, for example, that on your site, the query being executed looks like this
    There is no order by in the query so there is no way that the order will always be correct.
    tables/features.json?q=SELECT "test" FROM "/NamedMaps/NamedTables/in_order" WHERE MI_Intersects(obj,MI_Box(532973.0349999999,175371.3849957275,532980.0349999999,175378.3849957275,'EPSG:27700'))&page=1&pageLength=100S

    Without the order by, the response will be in the index order and you just can't control that.  If this change works for you in some cases, ok, but note that it might change behavior at any time. I did try this myself by the way on the world.tab layer and I could not control the order.




    ------------------------------
    Eric Blasenheim
    Spectrum Spatial Technical Product Manager
    Troy, NY
    ------------------------------



  • 9.  RE: Order of results in information pane

    Employee
    Posted 01-07-2020 17:43
    Also I did create a view ​in Spatial Manager (SELECT * from "/InstanceData/Testdata/world" order by Country) and attached that to the layer instead of the original table and now everything is coming back in the alphabetical order of the country field.

    ------------------------------
    Eric Blasenheim
    Spectrum Spatial Technical Product Manager
    Troy, NY
    ------------------------------