Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am working on a MapInfo plugin to convert MapInfo files to GeoJSON files.

I am having trouble matching up the object types of the two formats. Each GeoJSON object type is described in the documentation. The MapInfo object types are a bit more ambiguous. The best I can find is in the MapBasic reference file which says, for example:

  • OBJ_INFO_TYPE value: OBJ_TYPE_REGION
  • ID: 7
  • Object type: Region Object

This is obvious enough but what exactly is a region? Is it analogous to a Polygon? Or is it any closed object?

Can anyone point me towards a decent definition of each object type?

Update 2010-02-03:

I sent a message to the MapInfo support people who pointed me towards a section in the MapInfo User Guide headed "Map Objects as Part of Layers" which spells things out perfectly. I still can't find this page in the guide that I have (version 10.5) so I'll paste the relevant section below for anyone else in my position.

Quote starts here:

MapInfo Professional are made up of layers of map objects. There are five basic types of objects:

  • Regions: closed objects that cover a given area. These include polygons, ellipses, and rectangles. For example, country boundaries, postal code boundaries, sales territories.
  • Point objects: represent single locations of data. For example, customer locations, restaurants, parking meters. Points can also be combined into multipoint objects.
  • Line objects: open objects that cover a given distance. These include lines, polylines, and arcs. Examples are streets, rivers, power lines.
  • Text objects: text that describes a map or another object, such as labels and titles.
  • Collection objects: combination of region, line, and multipoint objects.

You can have each type of object in a separate layer (most common), or you can combine objects in the same layer.

share|improve this question
add comment

3 Answers

up vote 3 down vote accepted

A region in MapInfo (MapBasic) can match a Polygon or a MultiPolygon in GeoJSON. For the region to be a polygon it must: a) only have one polygon or b) only have one "main" polygon and one or more number of holes

If the region has multiple polygons with zero, one or more holes, I would consider this to be a MultiPolygon.

The GeoJSON describing is quite precise: "For type "Polygon", the "coordinates" member must be an array of LinearRing coordinate arrays. For Polygons with multiple rings, the first must be the exterior ring and any others must be interior rings or holes."

So you would need to check every part of the region to see if it is a hole in the main polygon or an extra polygon.

share|improve this answer
add comment

Even if you don't have FME, or use it for this translation, the documentation will help you here I think.

Check out the FME Readers and Writers Manual

It has info on both MapInfo TAB formats and GeoJSON.

For MapInfo Regions it says:

MapInfo region features specify area (polygonal) features. The areas that make up a single feature may or may not be disjoint, and may contain polygons which have holes. Each region has a pen style associated with it to control the color, width, and pen pattern used when its boundary is drawn. In addition, a region may set its brush pattern, foreground, and background color to control how the area it encloses will be filled.

share|improve this answer
add comment

This Library might be of good use for you.

http://mitab.maptools.org/

http://mitab.maptools.org/mitab-docs/mitab__capi_8cpp.html

share|improve this answer
    
Thanks but I'm programming in MapBasic, the programming language which comes with and was designed specifically for MapInfo, so dealing with MapInfo objects and the TAB format isn't a problem. I just want some more information on the different object types. –  Mr_Chimp Jan 28 '11 at 10:04
1  
OGR (gdal.org/ogr) will convert from Tab to GeoJSON. You can compare your MapBasic output to what OGR produces. This might be helpful. –  klewis Jan 30 '11 at 18:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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