Questions tagged [mapbasic]

MapBasic is a programming language for the creation of additional tools and functionality for MapInfo Pro Desktop GIS

Filter by
Sorted by
Tagged with
0 votes
0 answers
25 views

MapBasic: Rename failed error

I have a strange error with a mapbasic script running on MapInfo 16.0.2. The script is used to do the following tasks: There is one layer containing multiple polygons. One polygon represents the ...
user avatar
  • 13
0 votes
1 answer
22 views

Find Raster data in a Mapinfo workspace

I want to check if there is a raster layer in a map window using Mapbasic v2019. For Group Layers I use the following but I want to do the equivalent with Rasters. Sub Remove_Group (ByVal Group_Name ...
user avatar
  • 7,536
0 votes
1 answer
39 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 ...
user avatar
  • 309
1 vote
1 answer
29 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 ...
user avatar
0 votes
1 answer
124 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 ...
user avatar
0 votes
1 answer
31 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 ...
user avatar
  • 1
1 vote
0 answers
164 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 ...
user avatar
0 votes
1 answer
91 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?
user avatar
0 votes
0 answers
85 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$(...
user avatar
  • 7,536
0 votes
1 answer
54 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?
user avatar
  • 2,219
1 vote
0 answers
171 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 ...
user avatar
  • 11
0 votes
2 answers
42 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 ...
user avatar
  • 7,536
0 votes
1 answer
92 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 ...
user avatar
  • 7,536
0 votes
1 answer
249 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 ...
user avatar
1 vote
1 answer
251 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 ...
user avatar
  • 309
1 vote
2 answers
195 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?
user avatar
  • 746
0 votes
2 answers
189 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,...
user avatar
  • 7,536
0 votes
2 answers
155 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. ...
user avatar
  • 7,536
1 vote
1 answer
95 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 ...
user avatar
  • 7,536
1 vote
1 answer
278 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 ...
user avatar
  • 7,536
0 votes
1 answer
448 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 ...
user avatar
1 vote
1 answer
166 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 ...
user avatar
  • 7,536
0 votes
1 answer
338 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\...
user avatar
1 vote
1 answer
199 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. ...
user avatar
1 vote
0 answers
82 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 ...
user avatar
1 vote
2 answers
252 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 ...
user avatar
  • 11
1 vote
0 answers
193 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 ...
user avatar
  • 11
1 vote
1 answer
780 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 ...
user avatar
  • 13
2 votes
2 answers
891 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 ...
user avatar
  • 103
1 vote
1 answer
601 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 ...
user avatar
1 vote
1 answer
185 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 ...
user avatar
  • 13
1 vote
0 answers
174 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 ) ...
user avatar
0 votes
1 answer
571 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 ...
user avatar
0 votes
1 answer
519 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, ...
user avatar
0 votes
1 answer
185 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) '...
user avatar
0 votes
1 answer
122 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 ...
user avatar
0 votes
1 answer
150 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 ...
user avatar
  • 7,536
2 votes
2 answers
485 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....
user avatar
  • 7,536
0 votes
1 answer
2k 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 ...
user avatar
  • 504
1 vote
1 answer
138 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" ...
user avatar
  • 7,536
3 votes
1 answer
1k 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 ...
user avatar
  • 7,536
0 votes
1 answer
159 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....
user avatar
  • 7,536
1 vote
0 answers
138 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 ...
user avatar
  • 459
2 votes
2 answers
662 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 ...
user avatar
  • 21
2 votes
1 answer
410 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 ...
user avatar
1 vote
0 answers
170 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 ...
user avatar
0 votes
2 answers
989 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 ...
user avatar
  • 504
2 votes
1 answer
316 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 ...
user avatar
  • 459
0 votes
0 answers
108 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 = "" ...
user avatar
  • 7,536
0 votes
1 answer
726 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 ...
user avatar
  • 7,536

1
2 3 4 5 6