MapInfo Pro Developers User Group

 View Only
Expand all | Collapse all

MapBasic v2019

  • 1.  MapBasic v2019

    Employee
    Posted 01-10-2020 03:11
    We have released MapBasic v2019.

    You can find and download it here: MapBasic v2019

    Amongst the new features you will find:
    • Improved SQL syntax, like table alias, LIMIT keyword, improved join capabilities and where expressions support for Delete and Update statements
    • Getting a tables predominant object type via the TableInfo() function
    • Access to 15 more preferences via the GetPreference() function
    • -New attributes for the SystemInfo() and MapperInfo() functions
    • New Atan2() function


    ------------------------------
    Peter Horsbøll Møller
    Distinguished Engineer
    Pitney Bowes Software & Data
    ------------------------------


  • 2.  RE: MapBasic v2019

    Posted 01-13-2020 19:44
    Hi Peter

    Some nice additions.

    I've tested the TableInfo() function to get predominant object type.  This appears to only work on base tables - if I use this on a query result, it doesn't tell me the predominant type in the query (instead it gives me the result for the table the query is based on).   Is this working as designed or is this a bug?  Other TavbleInfo() functions give different results for base tables and their queries.

    Kalu

    ------------------------------
    Kalu Ribush
    Senior Mapping Specialist
    Department of Economic Development, Jobs, Transport and Resources (DEDJTR)
    Melbourne
    ------------------------------



  • 3.  RE: MapBasic v2019

    Employee
    Posted 01-14-2020 03:34
    Hi Kalu,

    Yeah, I imagine we get that information from the MAP file and therefor a query will copy the predominant style form the base table.

    In most cases that would be fine. But if you have a table with mixed object styles, the predominant object type can certainly be misleading for certain queries.

    I'll leave it to the developers if we can change the behavior to return the predominant object types from queries too. @Bob Fortin, @Anshul Goel, any ideas if this can be changed?​​

    ------------------------------
    Peter Horsbøll Møller
    Distinguished Engineer
    Pitney Bowes Software & Data
    ------------------------------



  • 4.  RE: MapBasic v2019

    Posted 01-14-2020 11:26
    If anybody wants to code this on their own, the information is in the header of the MAP file:

    Open a filestream and read four 32-bit integers like this:
    mapfile.position:= $013C; (hex address)
    Npoints = mapfile.readInt32;
    Nlines = mapfile.readInt32;
    Nregions = mapfile.readInt32;
    Ntexts = mapfile.readInt32;

    If it is an extended TAB file, use position = $0278 and read 64-bit integers instead.

    We have used such a function in RouteFinder for many years.

    ------------------------------
    Uffe Kousgaard
    ROUTEWARE
    Roskilde
    ------------------------------



  • 5.  RE: MapBasic v2019

    Posted 01-14-2020 17:00
    Thanks Peter,

    I'd be interested to hear if we can get this working for queries too.

    I can see if I have a table with mixed geometry, and I query the records for different geometries as separate layers, in the layer control the icons for all the geometries are shown for each query layer, either though q_poly only has polygons and q_point only has points. 


    MapInfo lets me set Style Overrides for each geometry, even though there is only a single geometry.



    ------------------------------
    Kalu Ribush
    Senior Mapping Specialist
    Department of Economic Development, Jobs, Transport and Resources (DEDJTR)
    Melbourne
    ------------------------------



  • 6.  RE: MapBasic v2019

    Posted 01-14-2020 17:11
    Kalu,
    The user interface in MapInfo Pro is, as you and Peter noted, only looking at the base table.  In the case of the layer control, it is just showing a possible override style for each possible type of geometry.  That is the only metadata we currently have. There is no such corollary for a query unless you save the results as a separate table.  In a query, we don't copy the data so we don't even have a temp table metadata to look in.
    In the case of large tables, it would take a potentially long time to read each record and build up the same metadata that comes more or less for free in a basetable.
    That said, it does not mean that it would always be slow to do this. I could imagine an option where we would do the query and update the UI. But that does not exist today so it would be a feature request. 
    By the way, if you were to edit one of those records and change the point to a line, it would immediately display in the override style that does nothing right now. So it kind of has a purpose.

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



  • 7.  RE: MapBasic v2019

    Posted 01-14-2020 17:18
    Hi Eric

    Understood.  Perhaps there should be some clarification in the MapBasic help file. 

    Regards

    ------------------------------
    Kalu Ribush
    Senior Mapping Specialist
    Department of Economic Development, Jobs, Transport and Resources (DEDJTR)
    Melbourne
    ------------------------------



  • 8.  RE: MapBasic v2019

    Posted 01-14-2020 18:54
    Related to this discussion, I've often wished when looking at a browser window for a table that there was an "OBJ" attribute displayed which identifies whether there is an object for a record and the object type.  It would also be really handy to be able to query records from a table by the object type (not just if there is an object, something like "select * where obj = point into selection")

    ------------------------------
    Kalu Ribush
    Senior Mapping Specialist
    Department of Economic Development, Jobs, Transport and Resources (DEDJTR)
    Melbourne
    ------------------------------



  • 9.  RE: MapBasic v2019

    Posted 01-14-2020 20:08
    Edited by Eric Blasenheim 01-15-2020 10:21
    You can use Pick Fields and use "Obj" as the expression. The string form (equivalent to Str$(Obj) will be displayed which will be the geometry type (Region, Pline, Point....) or empty string where there is no geometry.
    You can also check the box for "Save as Default Browser View" so that whenever you put that table in the browser it will display this extra column. ​ Clicking on the column will sort it and all records with no geometry will view at the top of the sort. 

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



  • 10.  RE: MapBasic v2019

    Employee
    Posted 01-15-2020 02:07
    And you query will work if you change it slightly:

    Select * From SomeTable Where Str$(OBJ) = "Point"​

    And now that we support the MapBasic constants in MapInfo Pro, you can also run a query like this:

    Select * From SomeTable Where Str$(ObjectInfo(OBJ, OBJ_INFO_TYPE)) = Str$(OBJ_TYPE_POINT)​


    ------------------------------
    Peter Horsbøll Møller
    Distinguished Engineer
    Pitney Bowes Software & Data
    ------------------------------



  • 11.  RE: MapBasic v2019

    Posted 01-15-2020 15:36
    Peter-

    Will there be an associated MapBasic Reference,MapBasic User Guide​, and Release notes added to the download page?  These were available with the MapBasic 17 release.

    Thanks,
    Jay Russell

    ------------------------------
    Jay Russell
    Sr. Technical Consultant
    CENTERPOINT ENERGY RESOURCES
    Houston TX
    ------------------------------



  • 12.  RE: MapBasic v2019

    Employee
    Posted 01-15-2020 15:52
    Hi Jay

    The Reference and User Guide can be found here: https://www.pitneybowes.com/us/support/products/software/mapinfo-mapbasic-support.html

    Let me check about the Release Notes as I can't locate that anywhere

    ------------------------------
    Peter Horsbøll Møller
    Distinguished Engineer
    Pitney Bowes Software & Data
    ------------------------------



  • 13.  RE: MapBasic v2019

    Employee
    Posted 01-16-2020 15:05
    Hi Jay,

    The Release Notes should be on the same site as the Reference and User Guide within the next 24 hours. We needed to make some adjustments to it as we had forgotten to include some important information.

    ------------------------------
    Peter Horsbøll Møller
    Distinguished Engineer
    Pitney Bowes Software & Data
    ------------------------------



  • 14.  RE: MapBasic v2019

    Posted 01-16-2020 16:02
    Thanks Peter.  I was looking for the updates to the Ribbon function calls as well as any references to the new Python capabilities.

    ------------------------------
    Jay Russell
    Sr. Technical Consultant
    CENTERPOINT ENERGY RESOURCES
    Houston TX
    ------------------------------



  • 15.  RE: MapBasic v2019

    Employee
    Posted 01-17-2020 05:34
    Hi Jay

    Not much news around the Ribbon function calls. Well, we did make some changes to the Alter and Create ButtonPad statement to make these support adding buttons to the ribbon. You can read more about this here: Adding control to the ribbon using the Alter/Create Buttonpad statements.

    As for Python, MapBasic 17.03 and MapBasic 2019 come with a number of Python examples to get you started

    If you have any specific questions, don't hesitate to ask them here in the forum.

    ------------------------------
    Peter Horsbøll Møller
    Distinguished Engineer
    Pitney Bowes Software & Data
    ------------------------------