Hello all,
I am scripting a MabBasic tool to do an audit of several thousand mapinfo tables.
One thing I am trying to capture is the min and max extents of the spatial objects in the table
But, some tables have no spatial objects at all and thus the command TableInfo(table_id,TAB_INFO_MINX) returns an error.
This is at a step where I have already confirmed that the table is a native mapinfo table, is mappable, I have captured the coordsys clause and the table does have a non-zero number of rows.
Is there a mapbasic command that can determine if a table contains spatial objects?
Nick Lawrence
Senior Spatial Science Officer | Geospatial Technologies
Engineering & Technology | Transport and Main Roads
Floor 19 | 313 Adelaide Street | Brisbane City Qld 4000
GPO Box 1412 | Brisbane City Qld 4001
P:
(07) 30667977
E: nicholas....@tmr.qld.gov.au
W: www.tmr.qld.gov.au
And you might want to just count the records with or without objects which might be faster.
Select Count(*) "nrecs" from parcels
where obj
into _q noselect hide
Now _q.nrecs will tell you the number of records with spatial objects
A quick test with a table holding around 100,000 records shows a slight improvement in performance.
1.8 – 2.4 secs for the grouped compared to 2.2 – 3.2 secs for the non-grouped query
Not really that big a difference
From: mapi...@googlegroups.com <mapi...@googlegroups.com>
On Behalf Of fjavier.gar...@gmail.com
Sent: 5. maj 2021 10:55
To: MapInfo-L <mapi...@googlegroups.com>
Subject: [MI-L] Re: In mapbasic, how to determine if a table contains spatial objects
This message originated Externally. Use proper judgement and caution with attachments, links, or responses. |
--
--
You received this message because you are subscribed to the
Google Groups "MapInfo-L" group.To post a message to this group, send
email to mapi...@googlegroups.com
To unsubscribe from this group, go to:
http://groups.google.com/group/mapinfo-l/subscribe?hl=en
For more options, information and links to MapInfo resources (searching
archives, feature requests, to visit our Wiki, visit the Welcome page at
http://groups.google.com/group/mapinfo-l?hl=en
---
You received this message because you are subscribed to the Google Groups "MapInfo-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
mapinfo-l+...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/mapinfo-l/672d9055-0732-451a-9985-c4a78722fe6bn%40googlegroups.com.