Questions tagged [mapbasic]
MapBasic is a programming language for the creation of additional tools and functionality for MapInfo Pro Desktop GIS
262
questions
0
votes
1answer
32 views
Using MapBasic, is there a method to compress GeoTIFF after programatically creating the GeoTIFF?
I need to compress the file sizes of GeoTIFFs that are created when running the MapBasic application. In a .Net application, I transform the GeoTIFF into a compressed JPG using ImageMagick; which ...
1
vote
1answer
17 views
MapBasic issue in creating Thematic with Shade
I'm trying to write a bit of code that looks the columns of a table and if they match by text, then generate a thematic of predefined ranges.
So far:
Include "MapBasic.def"
Declare Sub ...
0
votes
1answer
66 views
MapBasic, MapInfo Pro automation of existing Raster Operations
I have the latest version of MapInfo Pro and I would like to know if it is possible to fully automate the use of existing Raster operations into several files at once?
For example, having several ...
0
votes
1answer
25 views
Does Mapbasic work with MapInfo Discover?
Does Mapbasic work with MapInfo Discover?
From what I've been able to figure out it does not.
I was really hoping to make some macro style things to help automate some of our process but it doesn't ...
1
vote
0answers
81 views
Nearest statement - Mapbasic
When I use the nearest statement in mapbasic, not all the "from table" points show up. For example I am looking for the nearest distance neighbor of every point in a table (called Points). I use this ...
0
votes
1answer
78 views
Mapinfo - Compare Road Direction
I have two layers of Road Networks. How do I compare the difference in road direction between the two layers - both are polylines?
0
votes
0answers
52 views
Get last word of string in MapInfo
In pure Mapinfo SQL Update code I need to extract the last word of a string.
Ex
SUTHERLAND STREET
BURKE DEVELOPMENTAL ROAD
Street Not Specified
The following Update DCDB_DNRME Set road_type = Mid$(...
0
votes
1answer
36 views
Write variable content into specific cell of datasheet (Mapbasic)
I have a value stored in a variable. How can I write this value to a table (for example into Row2 Column4) using Mapbasic?
1
vote
0answers
103 views
Converting MapInfo to interactive layered PDF to access the full map?
I want to convert the full map I have in Pathloss 5.0/MapInfo 9.5.1 format into PDF so that I can access the whole map in a PDF file.
If I zoom in, the PDF file will be zoomed into the smallest ...
0
votes
2answers
38 views
Mapbasic v15 open wor within existing mapview
Using Run Application "G:\System\SSA\wor\Current\Townplanning_2018_v1\Zoning.wor" that's called from within a mapbasic program I want to load the workspace in the current map view rather than in a new ...
0
votes
1answer
61 views
Get code to run on every column in a table -Error “Could not find a public static method named …” -Mapbasic 17
I need to run a table update command on every column in a table. The code works fine when I manually define the column to work in but not when it is part of a for loop that gets all the column names I ...
0
votes
1answer
197 views
Custom tool for Mapinfo
I'm new to Mapinfo and Mapbasic as well.
I need to build a tool like in ArcMap (pythonaddins).
The goal is to have a gui application which has three dropdown lists.
First is a list of layers in ...
1
vote
1answer
230 views
MapBasic IDE Switch from Code view to Design view
I am brand new to mapbasic and I am working on a mapbasic project already developed. The previous developer has left and is not available for questions. I have searched mapbasic documentation and ...
1
vote
2answers
154 views
Show MapBasic Window equivalent in QGIS, e.g. Python Window
Is there a Show/Hide MapBasic Window (or equivalent) in QGIS such as in MapInfo?
I would like to learn SQL expressions parsing, or a Python Window viewer?
0
votes
2answers
128 views
Mapbasic Error - Alter Object cannot operate on an unitialized object variable
I get this error when running an mbx in Mapbasic
Include "MapBasic.def"
Include "Menu.def"
'assign brush/pen symbology for all but easements
dim b1 as Brush
b1 = makebrush (1,...
0
votes
2answers
104 views
Run mapbasic 32 bit mbx from larger mapbasic 64bit project
I need to run a 32-bit mbx within a 64-bit mbx -is this possible?
Basically within a larger 64bit mbx routine, I need to call a mapbasic 32 bit mbx so that I can apply some regex code to a table.
...
1
vote
1answer
81 views
Creating hotlinks only on objects that have value using MapBasic?
In mapbasic I am creating hotlinks with the code below. However when there is no value in the column it creates a hyperlink that doesn't work and this is frustrating for users. Is it possible to only ...
1
vote
1answer
206 views
Mapbasic work in current directory
Is it possible to get mapbasic to use the current directory for processes?
So rather than the following where WFolder is manually set as the working folder can I get it to just work in the folder ...
0
votes
1answer
359 views
How to print table information using mapbasic
How do I print a tables information in Mapbasic? I have a snippet of code - I want to select all features within a buffer and then print the results as a message in mapinfo that can be copied out into ...
1
vote
1answer
123 views
Mapbasic write and read csv into python tuple type structure
In mapbasic I need to read a csv into an array but arrange each row of the csv independently.
See the current result, code etc below.
I want it to be something like a python dictionary
([Bushfire_V ...
0
votes
1answer
202 views
Converting .grd to .asc using MapBasic in MapInfo 16
Can someone please provide an example to show how this would work.
For example, I am trying to convert from .GRD to .ASC, would my MapBasic code look like this:
public void Convert(string "C:\Users\...
1
vote
1answer
140 views
Performing multiple selection using MapBasic?
I am new to MapBasic programming.
I am trying to make multiple selection from a table where the ID number exist in my array and save all the values into another table which called results.
...
1
vote
0answers
76 views
MapInfo and Mapbasic [closed]
I'm looking to run an automation using MapInfo and Mapbasic.
What I want to achieve is to run through a MapInfo table on a row by row basis producing a map for each row within the table and then ...
1
vote
2answers
187 views
Opening and saving multiple shapefiles as .tab files? [closed]
How do I open several shapefiles, save as Tab files then append as one table using MapBasic code?
I have created a list that contains the tables and path to tables. But cannot loop to save tables ...
1
vote
0answers
156 views
MapBasic: expression does not evaluate to a column or table name
I want to create a new table using MapBasic to fill it later with log events. Those log will go in a new table created each year.
Here is my code (error occurs on row with Create Table):
' --- Log
...
1
vote
1answer
598 views
MapInfo/MapBasic SQL query
I've done a little bit of SQL query in MapBasic, but somehow get lost in this problem. I'm hoping that someone can help me out.
I have a table of polygons in 2 groups, F and E. F polygons are larger ...
2
votes
2answers
700 views
Mapbasic Code - Change Symbol Style Basic on Column Content
I wrote a piece of code a while ago for colouring lines depending on what was in a certain column. I struggled through it, but managed to get it to work. Now, I want to write a piece of code that will ...
1
vote
1answer
529 views
MapInfo 12.5 or 16 writing scripts
Fairly new to MapInfo both versions. I am a efficient user of ArcGIS, but my query being I was reading up on MapBasic but all the examples for these scripts are for running within MapInfo. Is there ...
1
vote
1answer
158 views
How to classify points in mapinfo table into their enclosing polygons (non overlapping polys) in one run
The objective is to classify a group of points to its enclosing polygons in one run rather than using select for each polygon and do it on one by one basis (for 100,000 point and 5000 polygons it can ...
1
vote
0answers
156 views
Get username info from active connection in Mapbasic [closed]
I'm trying to retrieve information on username from active connection (SQL Server Express) in MapInfo 11.5 32bit. First I tried using Server_ConnectInfo( ConnectionNo, SRV_CONNECT_INFO_SQL_USER_ID ) ...
0
votes
1answer
516 views
Create polyline using MapBasic (unknown number of nodes)
I'm trying to create pline using MapBasic. My idea was to create simple tool with dialog box containing couple of EditBox, PopupMenu's to retrieve pline attributes from user. So far I have only making ...
0
votes
1answer
428 views
Printing select query result in text file in mapbasic
I want to print a select query having number of records in text file in mapbasic but no successful results as i am using below code:
Open file "E:\Export.txt" for output as #1
Print #1, select Col1, ...
0
votes
1answer
159 views
unrecognized Do loop error in mapbasic
unrecognized command do is occurring when i am trying to use below code in mapbasic window. can anyone help me how to fix it although syntaz is correct
fetch first from t1
Do while Not EOT(t1)
'...
0
votes
1answer
105 views
Error in SQL query in mapbasic
I am writing below SQL query in mapbasic to insert columns from two tables t1 and t2 into table Sites but error is occuring "Variable or field t2.CELLID not defined"
Table Sites (Source integer, N ...
0
votes
1answer
120 views
One to many join mapbasic
I have a dataset with parcels with a unique lotplan - lets say it has 10,000 records. I have a dataset which has owner info which has one or many owners for each lotplan lets say it has 11,0000 ...
2
votes
2answers
407 views
Split polyline every Xm in MapBasic
I need to split large contour polyine datasets every 100m to be used for tiling. It currently has each (25cm) contour as a single (very long) line that extends beyond the tile and impacts labeling etc....
0
votes
1answer
1k views
Changing format of column from character to decimal or float in Mapinfo
We have some Mapbasic software that updates character fields in existing mapinfo tables to decimal or float. The character fields are mostly numeric but some values are N/A to indicate not applicable ...
1
vote
1answer
116 views
How to reuse code with a few inputs each time in mapbasic (sub or function)?
I need to run a string of code multiple times in a mbx while just changing 2 parameters. I tried a sub and function but both failed. How can I do this.
The code is
Print "Starting DCDB_FeatureName"
...
3
votes
1answer
903 views
replace character in string in mapbasic
Is there an equivalent to python .replace in mapbasic? Something like
search = search.replace(',', ' ')
I have found the search and replace tool for mapinfo and it works well but I need something ...
0
votes
1answer
126 views
MapBasic centroid in EPSG:28354
I have a table in MG94 Z 54 (EPSG:28354).
My MapBasic statement is
Commit Table DCDB As "C:\DCDB_Full_Copy.TAB" TYPE NATIVE Charset "WindowsLatin1" CoordSys Earth Projection 8, 116, "m", 141, 0, 0....
1
vote
0answers
109 views
HttpPOST and MapBasic
Can anyone provide an example of how one would use the (pre-defined) function
Function HttpPost( ByVal strURL As String
, ByVal strHeaders As String
, ByVal ...
2
votes
2answers
553 views
MapBasic: syntax to move a point?
I'm trying to write a tool that moves a selected point from its old location to wherever I click, but can't seem to find the code in the MapBasic user guide.
Ideally, I would like to select an ...
2
votes
1answer
383 views
Using FnodeTnode Tracing Extension in MapInfo?
I have downloaded FnodeTnode Tracer plugin from Pitney Bowes plugins repository website. It was just the MBX file that I have to regester it into my MIPRO and did it.
I have water distribution ...
1
vote
0answers
156 views
How to build Geometric network in MapInfo?
I have sample dataset of Water network. I wanted to make it geometrically connected network. I was trying to trace the network end to end, I have used "FnodeTnode tracing" plugin, but I was not lucky ...
0
votes
2answers
854 views
Update Column to a Value
I'm trying to update a column to a value in Mapinfo/Mapbasic using
Add Column "MMT_PARCEL_MP" (Limited_StratumTF )From Limited_Stratum Set To "T" Where intersects
and just getting an 'Unable to ...
2
votes
1answer
277 views
Use Windows function GetProductInfo via MapBasic
I develop a MapInfo-based GIS and I need to be able to determine the Windows OS of a given user. So far we have used a Windows function GetVersionEx (kernel32 library) to do this but the function ...
0
votes
0answers
85 views
Mapbasic code runs but no output is generated
My code (from previous questions here) to generate a list runs but there is no output...
Include "MapBasic.def"
Declare Sub Main
Sub Main
Dim path_to_temp_tables As String
path_to_temp_tables = ""
...
0
votes
1answer
650 views
Running a function in Mapbasic
I've been trying to invoke my first MB function to do some error handling and I keep getting an "Unrecognised command: OpenTab".
We have
Function OpenTab(ByVal TableName as String, ByVal sAlias as ...
0
votes
1answer
240 views
mapbasic update a column with centroid of object
I have a table that has a few polygons. I would like to extract the centroid of each polygon and fill up the columns named, Cent_X, and Cent_Y.
The syntax for getting the centroid is CentroidX(obj) ...
1
vote
1answer
238 views
MapBasic: skip popup menu dialog to get access to standard “Modify table structure” dialog
I'm trying to develop a small program using MapBasic for MapInfo.
I want to get access to the standard "Modify table structure" (or "Image registration" for raster tables) dialog through "Layer ...