MapInfo Pro Advanced Raster API

226 weergaven
Naar het eerste ongelezen bericht

Warren Vick

ongelezen,
29 apr 2018, 10:57:3529-04-2018
aan mapi...@googlegroups.com

With an investment in MapInfo Pro Advanced, I thought I delve into the types of raster analysis I could do with the MRR format in my own software. One thing that was a bit a disappointment was to see that there doesn’t seem to be any MapBasic support (in the form of new statements or functions) for Advanced rasters. In my Pro installation folder, I found a Raster\Documentation folder and a Windows help CHM file with some documentation on the API. I presume/hope it’s possible to create MapBasic declare statements to call these functions.

 

My immediate interest is how I can perform polygon-over-raster analysis… extracting min/max/avg/sum (or some other function that distils an aggregate) for cells that fall (partly/wholly… ideally I get to choose) inside region objects held in MapBasic variables. I found a function called GetPolygonStatistics in the API documentation but this only seems to enrich a whole table by adding a new field and populating in one operation.  I was looking for something for single region operations under my own MapBasic program control. Is that possible?

 

Anyone had any success with writing their own code to utilise MapInfo Pro Advanced’s raster capabilities? I’m wonder if this powerful functionality is not being fully utilised because it’s not been made very accessible?

 

Regards,

Warren Vick

 

Peter Horsbøll Møller

ongelezen,
30 apr 2018, 02:55:5330-04-2018
aan mapi...@googlegroups.com

Hi Warren,

I have worked a bit with the MapInfo Pro Raster API. As you have learned yourself it's a .NET API. Sofar we haven't created declarations for the API to be used from MapBasic.

That could very well be done. I'm not sure if we have that on our product backlog. You would probably loose a bit of the power of the API if you called the method directly from MapBasic. I'm not sure we would support things like processing threads running in the background for example.

You can find a sample application of mine showing how you could take advantage of the MapInfo Pro Raster API by calling custom .NET methods from MapBasic on github. The tool is called mbMapInfoRasterTool: https://github.com/PeterHorsbollMoller/mbMapInfoRasterTool

One of the sample does show how to use the Regions Stats. I'd think you woul dhave to save your polygon to a new temporary table, run it thru the Region Stats process and then read the values from the added columns.

 

Also answered on Li360:

https://li360.pitneybowes.com/s/question/0D58000004AP0YvCAL/can-i-access-the-mapinfo-pro-advanced-raster-api-from-mapbasic

 

Peter Horsbøll Møller

Pitney Bowes

--
--
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.

Warren Vick

ongelezen,
30 apr 2018, 04:52:4830-04-2018
aan mapi...@googlegroups.com

Thanks, Peter. I'll take a look at your mbMapInfoRasterTool. Further comments posted to LI360.

 

/Warren

Jose Gutierrez

ongelezen,
4 mrt 2019, 09:21:1004-03-2019
aan MapInfo-L
Hi Peter,

In relation to the MapInfo pro Raster and Mapbasic, I have been trying to find a way to call the raster function "Export"   from Mapbasic (to convert a .BIL rater to vector). 
It would be convenient  for me to do it in Mapbasic as I already have a tool programmed where a chain of task to are performed over those resulting vectors (currently, I am doing the export manually). 

Is there any place where I can find some documentation about the Raster export function to be called from a Mapbasic tool?
Thank you in advance

Peter Horsbøll Møller

ongelezen,
8 mrt 2019, 02:44:2208-03-2019
aan mapi...@googlegroups.com

Hi Jose

 

First of all, you need this .NET method to export your grid into a MapInfo vector table:

public static void ExportToTab(

        string inputFilePath,

        string outputTabFilePath,

        RasterExportToTabOptions ExportToTabOptions = null,

        RasterApiOptions apiOptions = null,

        IRasterProgressTracker progressTracker = null

)

 

Secondly, you have to set the RasterExportToTabOptions in the right way.

Consider setting this to true:

OutputAsRectangles

If OutputAsRectangles is set to true, writes rectangle objects in the output TAB file else writes point objects. The size of rectangle would be same as the source raster's cells. If ColorFromSource is true, the rectangles will have a solid fill with no border line and the fill color will match the source raster. If ColorFromSource is false, then the rectangles will have no fill (hollow) and have a simple black border line.

 

But there might be other settings too.

This does however require a bit of .NET development

 

Do let me know if I got your question wrong as there are multiple ways to convert a raster to vector

 

Peter Horsbøll Møller

Pitney Bowes

 

Jose Gutierrez

ongelezen,
17 jun 2019, 09:24:3717-06-2019
aan MapInfo-L
Thank you for your help Peter, 
Somehow I missed reply to you. I apologize for that.

To unsubscribe from this group and stop receiving emails from it, send an email to mapi...@googlegroups.com.

SM Sohelozzaman

ongelezen,
26 aug 2021, 21:37:2926-08-2021
aan MapInfo-L
Hi Vick

I saw your post in multiple platforms and I think I am facing a similar problem. I need to do something like Point Inspection of Mapinfo tool e.g, I will pass a coordinate and in return, it will provide me clutter data. I can get it by the Point Inspection tool. But I want to do it using Python. You said/suggested [in the community page] that you can do it using  Python/GDAL/OGR. Can you please share any code snippet? 

Allen beantwoorden
Auteur beantwoorden
Doorsturen
0 nieuwe berichten