MapBasic code for Add Layer (Open Raster *.MRR format) in New Map window or\and in Current Map Window

106 views
Skip to first unread message

Ilya KemeL

unread,
Apr 27, 2018, 5:35:18 AM4/27/18
to MapInfo-L
Dear,

I looking for code in MapBasis for open some RASTER layer in *.mrr format in current Map Window or \ and in the New Map Window.
I tried this code : 

Dim table As string
table = "C:\Projects\Analysis .tab"

Open Table table 
Map From table 
 

Hope for help, thanks

Bacon, Tom

unread,
Apr 27, 2018, 5:38:09 AM4/27/18
to mapi...@googlegroups.com

One way to get the code is to run through the process manually with the MapBasic window open in MapInfo. You can then just copy out the code that’s generated and amend it as necessary.

 

Regards,

 

Tom Bacon

Engineer

 

../../../_New%20Visual%20Identity/Templates/Email%20Signature/wsp_RGB.png

T +44 (0) 2030572254

 

WSP UK LTD

Mocatta House

Trafalgar Place

Brighton

BN1 4DU

 

wsp.com

 

Confidential

This message, including any document or file attached, is intended only for the addressee and may contain privileged and/or confidential information. Any other person is strictly prohibited from reading, using, disclosing or copying this message. If you have received this message in error, please notify the sender and delete the message. Thank you.

 

WSP UK Limited, a limited company registered in England & Wales with registered number 01383511. Registered office: WSP House, 70 Chancery Lane, London, WC2A 1AF. 

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Peter Horsbøll Møller

unread,
Apr 27, 2018, 6:24:50 AM4/27/18
to mapi...@googlegroups.com
You were close but fall into the same trap as many before you: a file is not the same as a table.

You need to convert your file reference to a table reference:

Dim sFile, sTable As string

sFile = "C:\Projects\Analysis.tab"

sTable = PathToTableName(sFile)

 

Open Table sFile 

Map From sTable


The solution above is just one way to do it

Peter Horsbøll Møller
Pitney Bowes
Sent from my mobile, sorry for any typos

Den 27. apr. 2018 kl. 11.38 skrev 'Bacon, Tom' via MapInfo-L <mapi...@googlegroups.com>:

One way to get the code is to run through the process manually with the MapBasic window open in MapInfo. You can then just copy out the code that’s generated and amend it as necessary.

 

Regards,

 

Tom Bacon

Engineer

 

<image001.png>

Ilya KemeL

unread,
Apr 29, 2018, 5:49:39 AM4/29/18
to MapInfo-L
Dear Tom,


Thank you a lot for great solution (MapBasic window) and for code example. How you can see, i'm a new in the MapBasic world.. So thanks again for a help.

Maybe you can help me with another issue, can i implement the Raster (GRID) calculation functions , or\and Raster (Grid) query functions by MapBasic command ?
For example, i want to implement script like : IF grid1 Value > 100 AND IF grid2 Value > 80 = Grid3 Value 1
Can i implement this script by MapInfo extensions ? I want to only select the grid files and run same logical function.



BR,
Reply all
Reply to author
Forward
0 new messages