MapInfo Pro Developers User Group

Expand all | Collapse all

MapBasic v2019

  • 1.  MapBasic v2019

    Posted 9 days ago
    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 6 days ago
    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

    Posted 5 days ago
    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 5 days ago
    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 5 days ago
    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

    Pitney Bowes
    Posted 5 days ago
    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 5 days ago
    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 5 days ago
    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

    Pitney Bowes
    Posted 5 days ago
    Edited by Eric Blasenheim 4 days ago
    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

    Posted 5 days ago
    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 4 days ago
    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

    Posted 4 days ago
    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

    Posted 3 days ago
    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 3 days ago
    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

    Posted 2 days ago
    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
    ------------------------------