2

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.

Is it possible to break it up using MapBasic to 100m segments?

I can see lots of advice for a manual process (https://groups.google.com/forum/#!topic/mapinfo-l/-T0SX4lqMXk) but this is not practical in such large datasets.

Note The data is multiple mapinfo extended files of 8 to 12 GB each. So the process has to work in MI 16, 64 bit.

The Use-Case The 25cm contour lines in SSA are very long and this impacts on performance of the SSA server. It also results in poor labelling of corner objects in the map window (typically only labelled in top LHS corner tile).

UPDATE We ran the process on a 1.5GB Tab file in 32 bit and imported it into SSA. It fixes the issues we faced but the issue is with the mapinfo extended files and the dll error when the toolbox is opened 64-bit.

" MapBasic applications that call a 32 bit DLL or other external code will need a 64 bit version of the DLL. This sort of application will require modification to run in the 64 bit version of MapInfo Pro. "

We've tried to bypass the DLL altogether, but there's function declarations that are needed

We've also tried to access the dll's to extract what I need - unsuccessfully.

What can we do?

  • 1
    If you want to use it for tiling, wouldn't it be appropriate to split the polylines using the tiling rectangles? – Peter Horsbøll Møller Jun 15 '17 at 21:10
  • @PeterHorsbøllMøller sounds interesting but I am not sure what you mean? I am open to suggestions. It's a 12GB mapinfo extended file of 25cm contours. It works but is slow and doesn't label properly in SSA...so we thought it would work better if each segment over 100m was split. – GeorgeC Jun 15 '17 at 22:51
  • 1
    You could create a vector grid for your area and use this to divide your contour file into smaller segments. Select the contour features, set the contour features as objects, select the vector grid features and use Split Taget on the SPATIAL tab to cut the contorus with your vector grid – Peter Horsbøll Møller Jun 16 '17 at 6:05
  • @PeterHorsbøllMøller -they were in 1km grids, the reason we merged them was that SSA shows every layer loaded in the legend and you would then get 600+ entries for the contours. So splitting the data isn't an option unless we can get SSA to only show one of the contour files in the legend. – GeorgeC Jun 17 '17 at 5:35
  • So the individual lines are not much longer than 1 or maybe 2 km? And even with that length the display is slower than if you have 100 meter lines? I were only suggesting splitting the lines, not dividing them into separate tables – Peter Horsbøll Møller Jun 19 '17 at 9:15
2

In order to make the feature from Routeware's Toolbox run in MapInfo Pro 64 bit, you need to remove all references to the 32 bit DLL from the source code.

Instead of removing all these features it's often faster to extract the single feature you are looking for.

In order to do so you'll have to:

  • save the file containing the feature to a new file (in order not to change the existing file)

  • remove reference to Toolbox.def

  • Add a new Main routine that calls the worker routing

  • Copying potential missing procedures/functions from ComFunctions.mb to the new file

  • Include declarations for the copied procedures/functions

Here's a tool that will run in MapInfo Pro 64 bit (compiled for v16.0) but you can use the source code to compile it to earlier versions too: SplitlineStandalone.mb

I added a reference back to Toolbox to the sourcecode.

'****************************
'This is based on the ToolBox by Routeware, http://www.routeware.dk/toolbox.php
'It has been modified to work in MapInfo Pro x64
'It will run instantly and ask what table to process
'It will not integrate itself into the Ribbon interface
'****************************
  • Horsbell Thanks - I am getting an error on ln97 - Variable of Field limit not defined – GeorgeC Jun 19 '17 at 13:15
  • 1
    Ah, I have fixed that error and now also run the tool myself. It works on my end now – Peter Horsbøll Møller Jun 19 '17 at 13:54
2

Install RouteWare Toolbox 1.07 a free addon for MapInfo

http://www.routeware.dk/toolbox.php

And just use "Split Line" tool and specify a distance.

enter image description here

Simple as that.

It will create a table with lines split and you will have to add that table to map window.

enter image description here

  • 1
    And you can even find the sourcecode for the Toolbox tool on Routeware's web page. – Peter Horsbøll Møller Jun 15 '17 at 21:08
  • @sys49152 -great suggestion but it doesn't open in MI 16 64bit for me (toolbox.dll) error and I need it to run on mapinfo extended files which don't open in my MI15 32-bit (in which routware does work) – GeorgeC Jun 16 '17 at 1:57
  • If I used the mb module for splitline, how could I build an interface in MI16 to use it with? – GeorgeC Jun 16 '17 at 6:05
  • @sys49152 - This works great for non- mapinfo extended tab files. I have tried a few things -without success. Please see updated question. – GeorgeC Jun 19 '17 at 4:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.