Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

mitab · MITAB Users List

The Yahoo! Groups Product Blog

Check it out!

Group Information

? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Messages

Advanced
Messages Help
Messages 1338 - 1367 of 1437   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#1338 From: "bernard.hall99" <bernard.hall99@...>
Date: Fri May 1, 2009 5:43 pm
Subject: fwtools conversion from CSV to MapInfo
bernard.hall99
Send Email Send Email
 
Bernard Hall wrote:
> Is it possible to create mapinfo 8.5 files (tab / map) from CSV files?
>
> I seem to only be able to create MapInfo 9.0 files
>

Bernard,

I wasn't aware there was a significant distinction.  I would suggest you join
and ask on the MITAB mailing list.  MITAB is the underlying library used by OGR
for mapinfo access.

    http://mitab.maptools.org/

Best regards,
--
---------------------------------------+--------------------------------
---------------------------------------+------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@...
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

#1339 From: "Mukesh Kumar" <mukeshkb4u@...>
Date: Mon May 11, 2009 6:50 am
Subject: [Fwd: Re: Building mitab for Pocket PC / WCE]
mukeshkb4u
Send Email Send Email
 
Hello Sir,
  Can you please give me Guidelines for Building Mitab for Wince6.0.
I am successfully able to compile GDAL1.4.0 for wince. But this project is
exporting gdalce.dll - dymamic-link library and
gdalce_i.lib - import library. I am not able to get Mitab.lib or dll. What
changes i need to do to get the result.

Thanks
Mukesh Kumar
--- In mitab@yahoogroups.com, "jerha202" <jerha202@...> wrote:
>
> I'm working together with Sune (deepfrenzee) on this project and just
> wanted to let you know that we are now successfully using Mitab on
> WCE from the GDAL distribution, so thanks to Daniel and Mateusz for
> the support.
>
> For the record: A few changes were needed to make the latest GDAL
> (v1.5.0) build for WCE:
>  - In the gdalce_common property sheet, under Common Properties /
> C/C++ / Preprocessor, remove preprocessor definition OGR_ENABLED.
>  - Add the file ogr/ogrsf_frmts/shape/shp_vsi.c to the project.
>  - In the gdalce_dll property sheet, under Configuration Properties /
> Linker / Input for the Release configuration, add the additional
> dependency ccrtrtti.lib.
>
> In addition, to access the MITAB API, we simply changed the project
> to build a static library (.lib) instead of a dll (gdalce_dll
> property sheet, Configuration Properties / General, Configuration
> Type). That way we avoid the problem that the Mitab API is not
> exported in the dll.
>
> Regards,
> Jerker Hammarberg
> Tetrasoft
>
> --- In mitab@yahoogroups.com, Daniel Morissette <dmorissette@>
> wrote:
> >
> > Forwarding Mateusz' reply...
> >
> > -------- Original Message --------
> > Subject: Re: [mitab] Building mitab for Pocket PC / WCE
> > Date: Wed, 06 Feb 2008 17:27:55 +0100
> > From: Mateusz Loskot
> > To: Daniel Morissette
> > CC: mitab@yahoogroups.com
> >
> > Daniel Morissette wrote:
> > > deepfrenzee wrote:
> > >> Hi
> > >>
> > >> We've been trying to build mitab for the pocket pc platform, so
> far
> > >> unsuccessfully.
> >
> > Daniel / deepfrenzee,
> >
> > Yes, this is tricky, but feasible. At least, I've managed to build
> MITAB
> > as a part of the GDAL project (what Daniel has mentioned).
> >
> > >> The problem is a lot of headers and some basic winapi is missing
> on WCE.
> >
> > Yes, there are, but mostly not WinAPI but C library is incomplete.
> > For this purpose, I've developed an extension/supplement for the C
> > library and POSIX on Windows CE - WCELIBCEX:
> >
> > http://mateusz.loskot.net/projects/wcelibcex/
> >
> > The WCELIBCEX is used as a compilation enabler while
> > building GDAL for Windows CE.
> >
> > >> Right now we are trying to slim down the library to the bare
> minimin
> > >> of what we need, to see how far that gets us.
> >
> > I believe this is unnecessary because MITAB compiles without
> > problems using WCELIBCEX.
> >
> > >> Help and suggestions are most welcome.
> > >>
> > >
> > > I believe MITAB has already been built for WCE by Mateusz Loskot
> from
> > > the GDAL project as part of an overall effort to port GDAL/OGR
> (which
> > > includes MITAB) to WCE, the default MITAB makefiles may just be
> missing
> > > some compile flags.
> > >
> > > I'd recommend that you post this question to the gdal-dev list
> where
> > > Mateusz is listening and may be able to provide more info:
> > > http://lists.osgeo.org/mailman/listinfo/gdal-dev
> >
> > Here is solution for Visual C++ 8.0 (2005)
> >
> > http://trac.osgeo.org/gdal/browser/trunk/gdal/wince
> >
> > However, this one may needs some update and I'm going to do it soon.
> >
> > Here, you can find alternative solution for Visual C++
> > and I this one is more up to date:
> >
> > http://trac.osgeo.org/moss4g/browser/trunk/libs/gdal
> >
> > This is a part of the more complete framework of a bunch of
> libraries I
> > ported and maintain for Windows CE platform under common name -
> MOSS4G
> >
> > http://trac.osgeo.org/moss4g/browser/trunk/libs/
> >
> > Feel free to send your further questions to gdal-dev,
> > I'll do my best to help.
> >
> > p.s. Daniel, I believe I've not subscribed to the
> mitab@yahoogroups.com
> > list, so please could you forward my message there? Thank you!
> >
> > Cheers
> > --
> > Mateusz Loskot
> > http://mateusz.loskot.net
> >
>

#1340 From: "Mukesh Kumar" <mukeshkb4u@...>
Date: Mon May 11, 2009 6:51 am
Subject: Mitab dll for wince 6.0
mukeshkb4u
Send Email Send Email
 
Hi All,
  Can anyone please give me Guidelines for Building Mitab for Wince6.0.
I am successfully able to compile GDAL1.4.0 for wince. But this project is
exporting
gdalce.dll - dymamic-link library and
gdalce_i.lib - import library.
I am not able to get Mitab.dll . What changes i need to do to get the result.

Thanks
Mukesh Kumar

#1341 From: "adeel_razza" <adeel_razza@...>
Date: Thu May 28, 2009 7:27 pm
Subject: Few basic questions
adeel_razza
Send Email Send Email
 
Hi everyone!

I will be using the mitab C API for the first time in a week or so and I had
some basic questions which might make a few of you laugh. Any help however would
be appreciated. The C API documentation I will be referring to in the following
questions can be found on:
http://mitab.maptools.org/mitab-docs/mitab__capi_8cpp.html#1cfffe5b83810aefc5df8\
f9598d4ff99

Q1. What is meant by the field width? Is it the number of characters a field can
hold?

Q2. The dimensions of the MBR of a text feature are defined in "ground units" in
the C API documentation. What exactly is a ground unit? I did some research on
this and wikipedia gave the following definition: "A ground is a unit of area
used in India approximately equal to 203 square meters (2,185 ft²)". I really
doubt that is what the C API documentation is referring to.

Q3.What exactly is an "interior ring" of a polygon? Is it simply a ring inside
the outer ring of a polygon or is it referring to a hole?

Q4. For the following two functions it is not specified in the C API
documentation what the returned value will be if the object has no geometry or
the part or the point number is invalid:

Function #1:
double MITAB_STDCALL  mitab_c_get_vertex_x (mitab_feature feature, int part, int
vertex),

Function #2:
double MITAB_STDCALL  mitab_c_get_vertex_y (mitab_feature feature, int part, int
vertex)

Q5. Functions such as the one shown below return a "0-based index" for a field
according to the C API documentation. Does this simply mean that the first field
will have an index of 0?:

Example Function:
int MITAB_STDCALL  mitab_c_add_field (mitab_handle dataset, const char
*field_name, int field_type, int width, int precision, int indexed, int unique)

Like I said before any help will be aprreciated.

Regards,
Adeel.

#1342 From: "robbertouwehand" <robbert.ouwehand@...>
Date: Thu Jun 4, 2009 9:49 am
Subject: Re: Few basic questions
robbertouwehand
Send Email Send Email
 
Hi!

I can only answer the first, third and fifth question for you. Any others are
beyond me as I've only just started trying out mitab myself.

Q1: Assuming you're talking about mitab_c_add_field: Then you're right. For
decimals it represents the number of integers used to represent the number, for
character fields it represents the number of characters that that field can hold
(Kind of like MySQL's CHAR field. CHAR(n) defines a field that can hold n
characters).

Q3: Every polygon has an outer ring which describes it. The outer ring is simply
a set of points which are connected. Polygons can contain one or more 'holes'.
Holes in polygons are defined as interior rings and the ring is the 'edges' of
that hole. Everything that is 'inside' the interior ring is the actual hole.

A (lame) simple example: Say you have an island. This can easily modelled by a
polygon. The shape of the island is the exterior ring. Now image that that
island has a circular, impassable crater on it. That crater can be modelled
using an interior ring, where the interior ring are the boundaries of that
crater.

Q5: Yes. The first field you create will have index 0 in the dataset, the second
field index 1, etc..

Best regards,
Robbert


--- In mitab@yahoogroups.com, "adeel_razza" <adeel_razza@...> wrote:
>
> Hi everyone!
>
> I will be using the mitab C API for the first time in a week or so and I had
some basic questions which might make a few of you laugh. Any help however would
be appreciated. The C API documentation I will be referring to in the following
questions can be found on:
http://mitab.maptools.org/mitab-docs/mitab__capi_8cpp.html#1cfffe5b83810aefc5df8\
f9598d4ff99
>
> Q1. What is meant by the field width? Is it the number of characters a field
can hold?
>
> Q2. The dimensions of the MBR of a text feature are defined in "ground units"
in the C API documentation. What exactly is a ground unit? I did some research
on this and wikipedia gave the following definition: "A ground is a unit of area
used in India approximately equal to 203 square meters (2,185 ft²)". I really
doubt that is what the C API documentation is referring to.
>
> Q3.What exactly is an "interior ring" of a polygon? Is it simply a ring inside
the outer ring of a polygon or is it referring to a hole?
>
> Q4. For the following two functions it is not specified in the C API
documentation what the returned value will be if the object has no geometry or
the part or the point number is invalid:
>
> Function #1:
> double MITAB_STDCALL  mitab_c_get_vertex_x (mitab_feature feature, int part,
int vertex),
>
> Function #2:
> double MITAB_STDCALL  mitab_c_get_vertex_y (mitab_feature feature, int part,
int vertex)
>
> Q5. Functions such as the one shown below return a "0-based index" for a field
according to the C API documentation. Does this simply mean that the first field
will have an index of 0?:
>
> Example Function:
> int MITAB_STDCALL  mitab_c_add_field (mitab_handle dataset, const char
*field_name, int field_type, int width, int precision, int indexed, int unique)
>
> Like I said before any help will be aprreciated.
>
> Regards,
> Adeel.
>

#1343 From: "robbertouwehand" <robbert.ouwehand@...>
Date: Thu Jun 4, 2009 10:03 am
Subject: Compiling Mitab on Visual C++ 2008 Express Edition (or VS Pro 2008)
robbertouwehand
Send Email Send Email
 
Hi there,

I've been trying to get Mitab to compile on Visual C++ 2008 Express Edition and
on Visual Studio Professional 2008, but to no avail. I'll describe, step by
step, what I did.

I first moved the SLN and the VCPROJ files to the MITab root folder. Then I
launched the project file, converted the SLN file so that Visual C++ 2008 EE
could work with it, altered the header files as described in
contrib/vcproj/README_VCPROJ.TXT.

I first get 74 errors regarding vsnprintf. After commenting out #define
vsnprintf _vsnprintf in cpl_config.h, the compile fails because it can't read
MITab.def. I moved the MITab.def file to the MITab root folder and attempt to
recompile, but I get 43 linker errors of the following kind:

1>.\MITab.def(90) : warning LNK4017: Define statement not supported for the
target platform; ignored

1>cpl_csv.obj : error LNK2001: unresolved external symbol _CPLSetTLS

All errors result from the unsupported define statements.

What am I doing wrong?

Best regards,
Robbert

#1344 From: "adeel_razza" <adeel_razza@...>
Date: Fri Jun 5, 2009 3:47 pm
Subject: Re: Few basic questions
adeel_razza
Send Email Send Email
 
Thanks Robert. Greatly appreciated.

--- In mitab@yahoogroups.com, "robbertouwehand" <robbert.ouwehand@...> wrote:
>
> Hi!
>
> I can only answer the first, third and fifth question for you. Any others are
beyond me as I've only just started trying out mitab myself.
>
> Q1: Assuming you're talking about mitab_c_add_field: Then you're right. For
decimals it represents the number of integers used to represent the number, for
character fields it represents the number of characters that that field can hold
(Kind of like MySQL's CHAR field. CHAR(n) defines a field that can hold n
characters).
>
> Q3: Every polygon has an outer ring which describes it. The outer ring is
simply a set of points which are connected. Polygons can contain one or more
'holes'. Holes in polygons are defined as interior rings and the ring is the
'edges' of that hole. Everything that is 'inside' the interior ring is the
actual hole.
>
> A (lame) simple example: Say you have an island. This can easily modelled by a
polygon. The shape of the island is the exterior ring. Now image that that
island has a circular, impassable crater on it. That crater can be modelled
using an interior ring, where the interior ring are the boundaries of that
crater.
>
> Q5: Yes. The first field you create will have index 0 in the dataset, the
second field index 1, etc..
>
> Best regards,
> Robbert
>
>
> --- In mitab@yahoogroups.com, "adeel_razza" <adeel_razza@> wrote:
> >
> > Hi everyone!
> >
> > I will be using the mitab C API for the first time in a week or so and I had
some basic questions which might make a few of you laugh. Any help however would
be appreciated. The C API documentation I will be referring to in the following
questions can be found on:
http://mitab.maptools.org/mitab-docs/mitab__capi_8cpp.html#1cfffe5b83810aefc5df8\
f9598d4ff99
> >
> > Q1. What is meant by the field width? Is it the number of characters a field
can hold?
> >
> > Q2. The dimensions of the MBR of a text feature are defined in "ground
units" in the C API documentation. What exactly is a ground unit? I did some
research on this and wikipedia gave the following definition: "A ground is a
unit of area used in India approximately equal to 203 square meters (2,185
ft²)". I really doubt that is what the C API documentation is referring to.
> >
> > Q3.What exactly is an "interior ring" of a polygon? Is it simply a ring
inside the outer ring of a polygon or is it referring to a hole?
> >
> > Q4. For the following two functions it is not specified in the C API
documentation what the returned value will be if the object has no geometry or
the part or the point number is invalid:
> >
> > Function #1:
> > double MITAB_STDCALL  mitab_c_get_vertex_x (mitab_feature feature, int part,
int vertex),
> >
> > Function #2:
> > double MITAB_STDCALL  mitab_c_get_vertex_y (mitab_feature feature, int part,
int vertex)
> >
> > Q5. Functions such as the one shown below return a "0-based index" for a
field according to the C API documentation. Does this simply mean that the first
field will have an index of 0?:
> >
> > Example Function:
> > int MITAB_STDCALL  mitab_c_add_field (mitab_handle dataset, const char
*field_name, int field_type, int width, int precision, int indexed, int unique)
> >
> > Like I said before any help will be aprreciated.
> >
> > Regards,
> > Adeel.
> >
>

#1345 From: "adeel_razza" <adeel_razza@...>
Date: Fri Jun 5, 2009 7:30 pm
Subject: Trouble using the mitab C Api
adeel_razza
Send Email Send Email
 
Hi Folks,

I was wondering what was required to use the mitab C API only. On
"http://mitab.maptools.org/" it is mentioned that all you need to run the mitab
C API is mitab.dll+mitab_capi.h which is part of "MITAB-1.7.0-WIN32.ZIP". And in
the mitab C API documentation
(http://mitab.maptools.org/mitab-docs/mitab__capi_8cpp.html) it is mentioned
that all you need to use the C API is to simply include "mitab_capi.h" and use
the functions defined in mitab_capi.cpp.

I've tried this for a test project but I get the following error: "error
LNK2019: unresolved external symbol _mitab_c_open@4 referenced in function
_main". Therefore I included mitab_capi.cpp as a source file in my project and I
get linker errors of type "error LNK2019: unresolved external symbol". This
leads me to believe that I need to compile the libraries using makefile.vc, but
that is contrary to what is stated on "http://mitab.maptools.org/" (since the
website says that all you need to run the mitab C API is mitab.dll and
mitab_capi.h). Could someone please help me sort this out?

Regards,
Adeel.

#1346 From: Daniel Morissette <dmorissette@...>
Date: Fri Jun 5, 2009 7:46 pm
Subject: Re: Trouble using the mitab C Api
dan_morissette
Send Email Send Email
 
adeel_razza wrote:
>
> I was wondering what was required to use the mitab C API only. On
"http://mitab.maptools.org/" it is mentioned that all you need to run the mitab
C API is mitab.dll+mitab_capi.h which is part of "MITAB-1.7.0-WIN32.ZIP". And in
the mitab C API documentation
(http://mitab.maptools.org/mitab-docs/mitab__capi_8cpp.html) it is mentioned
that all you need to use the C API is to simply include "mitab_capi.h" and use
the functions defined in mitab_capi.cpp.
>

I believe you need to link with the mitab_i.lib in order to use the
mitab.dll from a C program, but I see that I didn't include it in
mitab-1.7.0-win32.zip.

You should be able to build it easily with the makefiles anyway (see
instructions in the README.TXT file)... and then just #include
mitab_capi.h in your C code, link with mitab_i.lib and put mitab.dll in
your PATH at runtime.

Daniel
--
Daniel Morissette
http://www.mapgears.com/

#1347 From: "adeel_razza" <adeel_razza@...>
Date: Mon Jun 8, 2009 1:15 pm
Subject: Re: Trouble using the mitab C Api
adeel_razza
Send Email Send Email
 
Thanks Daniel!

--- In mitab@yahoogroups.com, Daniel Morissette <dmorissette@...> wrote:
>
> adeel_razza wrote:
> >
> > I was wondering what was required to use the mitab C API only. On
"http://mitab.maptools.org/" it is mentioned that all you need to run the mitab
C API is mitab.dll+mitab_capi.h which is part of "MITAB-1.7.0-WIN32.ZIP". And in
the mitab C API documentation
(http://mitab.maptools.org/mitab-docs/mitab__capi_8cpp.html) it is mentioned
that all you need to use the C API is to simply include "mitab_capi.h" and use
the functions defined in mitab_capi.cpp.
> >
>
> I believe you need to link with the mitab_i.lib in order to use the
> mitab.dll from a C program, but I see that I didn't include it in
> mitab-1.7.0-win32.zip.
>
> You should be able to build it easily with the makefiles anyway (see
> instructions in the README.TXT file)... and then just #include
> mitab_capi.h in your C code, link with mitab_i.lib and put mitab.dll in
> your PATH at runtime.
>
> Daniel
> --
> Daniel Morissette
> http://www.mapgears.com/
>

#1348 From: "adeel_razza" <adeel_razza@...>
Date: Wed Jun 24, 2009 7:23 pm
Subject: Porblem using GDAL v 1.6.0 and MITAB v 1.7.0 together in one routine
adeel_razza
Send Email Send Email
 
Hi,

I am trying to import a spacial reference system into an OGRSpatialReference
object using the following function which requires a MapInfo style CoordSys
definition string: OGRErr OGRSpatialReference::importFromMICoordSys(const char *
pszCoordSys) (websited address:
http://www.gdal.org/ogr/classOGRSpatialReference.html#1acf0f6cac3125cc878a994330\
33c140). This function requires the routine in which it is used to be linked to
the MITAB library. The problem is that both the MITAB and GDAL libraries contain
OGR and CPL. This creates the following linker errors when I try to compile my
routine on Microsoft Visual C++ 2008 Express Edition (VC 9.0), using mitab
version 1.7.0 and gdal version 1.6.0.


Linking...
LINK : C:\RayPredict\Source\Terrain Database Convertor\Debug\Terrain Database
Convertor.exe not found or not built by the last incremental link; performing
full link
mitab.lib(mitab_capi.obj) : error LNK2005: "public: virtual int __thiscall
OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already
defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_imapinfofile.obj) : error LNK2005: "public: virtual int
__thiscall OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ)
already defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_miffile.obj) : error LNK2005: "public: virtual int __thiscall
OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already
defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_tabfile.obj) : error LNK2005: "public: virtual int __thiscall
OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already
defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_feature.obj) : error LNK2005: "public: virtual int __thiscall
OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already
defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_coordsys.obj) : error LNK2005: "public: virtual int __thiscall
OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already
defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_bounds.obj) : error LNK2005: "public: virtual int __thiscall
OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already
defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_tabseamless.obj) : error LNK2005: "public: virtual int
__thiscall OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ)
already defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_tabview.obj) : error LNK2005: "public: virtual int __thiscall
OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already
defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_utils.obj) : error LNK2005: "public: virtual int __thiscall
OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already
defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_middatafile.obj) : error LNK2005: "public: virtual int
__thiscall OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ)
already defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_spatialref.obj) : error LNK2005: "public: virtual int __thiscall
OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already
defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_mapheaderblock.obj) : error LNK2005: "public: virtual int
__thiscall OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ)
already defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_mapfile.obj) : error LNK2005: "public: virtual int __thiscall
OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already
defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_datfile.obj) : error LNK2005: "public: virtual int __thiscall
OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already
defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_indfile.obj) : error LNK2005: "public: virtual int __thiscall
OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already
defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_mapobjectblock.obj) : error LNK2005: "public: virtual int
__thiscall OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ)
already defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_feature_mif.obj) : error LNK2005: "public: virtual int
__thiscall OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ)
already defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_mapcoordblock.obj) : error LNK2005: "public: virtual int
__thiscall OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ)
already defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_rawbinblock.obj) : error LNK2005: "public: virtual int
__thiscall OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ)
already defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_geometry.obj) : error LNK2005: "public: virtual int __thiscall
OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already
defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_idfile.obj) : error LNK2005: "public: virtual int __thiscall
OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already
defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_tooldef.obj) : error LNK2005: "public: virtual int __thiscall
OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already
defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_mapindexblock.obj) : error LNK2005: "public: virtual int
__thiscall OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ)
already defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_maptoolblock.obj) : error LNK2005: "public: virtual int
__thiscall OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ)
already defined in gdal_i-vc9.lib(gdal16-vc9.dll)
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: static unsigned int __cdecl
std::char_traits::length(char const *)" (?length@?$char_traits@D@std@@SAIPBD@Z)
already defined in mitab.lib(mitab_capi.obj)
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: __thiscall
std::basic_string,class std::allocator >::basic_string,class std::allocator
>(class std::basic_string,class std::allocator > const &)"
(??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z)
already defined in mitab.lib(mitab_capi.obj)
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: char const * __thiscall
std::basic_string,class std::allocator >::c_str(void)const "
(?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ)
already defined in mitab.lib(mitab_capi.obj)
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: __thiscall
std::basic_string,class std::allocator >::~basic_string,class std::allocator
>(void)"
(??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already
defined in mitab.lib(mitab_capi.obj)
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: class
std::basic_string,class std::allocator > & __thiscall std::basic_string,class
std::allocator >::operator=(class std::basic_string,class std::allocator > const
&)"
(??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@ABV01@\
@Z) already defined in mitab.lib(mitab_capi.obj)
LINK : fatal error LNK1104: cannot open file 'libcp.lib'



Is there any way to compile the MITAB and GDAL library in the same C++ routine
and avoid these errors?

Best Regards,
Adeel Raza.

#1349 From: "adeel_razza" <adeel_razza@...>
Date: Thu Jun 25, 2009 6:08 pm
Subject: Re: Compiling Mitab on Visual C++ 2008 Express Edition (or VS Pro 2008)
adeel_razza
Send Email Send Email
 
Hi Robert,

I tried compiling Mitab on Visual C++ 2008 Express Edition first as well until I
realized that it only compiles on VC 6.0. If you don't have VC 6.0 I would be
happy to send you a compiled version of the library in a zip file. Let me know
if this would be a desirable solution.

Regards,
Adeel.

--- In mitab@yahoogroups.com, "robbertouwehand" <robbert.ouwehand@...> wrote:
>
> Hi there,
>
> I've been trying to get Mitab to compile on Visual C++ 2008 Express Edition
and on Visual Studio Professional 2008, but to no avail. I'll describe, step by
step, what I did.
>
> I first moved the SLN and the VCPROJ files to the MITab root folder. Then I
launched the project file, converted the SLN file so that Visual C++ 2008 EE
could work with it, altered the header files as described in
contrib/vcproj/README_VCPROJ.TXT.
>
> I first get 74 errors regarding vsnprintf. After commenting out #define
vsnprintf _vsnprintf in cpl_config.h, the compile fails because it can't read
MITab.def. I moved the MITab.def file to the MITab root folder and attempt to
recompile, but I get 43 linker errors of the following kind:
>
> 1>.\MITab.def(90) : warning LNK4017: Define statement not supported for the
target platform; ignored
>
> 1>cpl_csv.obj : error LNK2001: unresolved external symbol _CPLSetTLS
>
> All errors result from the unsupported define statements.
>
> What am I doing wrong?
>
> Best regards,
> Robbert
>

#1350 From: Daniel Morissette <dmorissette@...>
Date: Thu Jun 25, 2009 7:43 pm
Subject: Re: Porblem using GDAL v 1.6.0 and MITAB v 1.7.0 together in one routine
dan_morissette
Send Email Send Email
 
adeel_razza wrote:
> Hi,
>
> I am trying to import a spacial reference system into an OGRSpatialReference
object using the following function which requires a MapInfo style CoordSys
definition string: OGRErr OGRSpatialReference::importFromMICoordSys(const char *
pszCoordSys) (websited address:
http://www.gdal.org/ogr/classOGRSpatialReference.html#1acf0f6cac3125cc878a994330\
33c140). This function requires the routine in which it is used to be linked to
the MITAB library. The problem is that both the MITAB and GDAL libraries contain
OGR and CPL. This creates the following linker errors when I try to compile my
routine on Microsoft Visual C++ 2008 Express Edition (VC 9.0), using mitab
version 1.7.0 and gdal version 1.6.0.
>

A copy of the MITAB library is included in the
gdal/ogr/ogrsf_frmts/mitab subdirectory of the GDAL/OGR distribution. So
it should be possible to adapt your application with some minor changes
to work only with GDAL/OGR.

Daniel
--
Daniel Morissette
http://www.mapgears.com/

#1351 From: Daniel Morissette <dmorissette@...>
Date: Thu Jun 25, 2009 7:46 pm
Subject: Re: Re: Compiling Mitab on Visual C++ 2008 Express Edition (or VS Pro 2008)
dan_morissette
Send Email Send Email
 
adeel_razza wrote:
> Hi Robert,
>
> I tried compiling Mitab on Visual C++ 2008 Express Edition first as well until
I realized that it only compiles on VC 6.0. If you don't have VC 6.0 I would be
happy to send you a compiled version of the library in a zip file. Let me know
if this would be a desirable solution.
>

The VCPROJ files may not work, but in case that helps, the makefile.vc
should work with VC++ 2008 Express Edition, that's what I use to produce
the releases.

Daniel
--
Daniel Morissette
http://www.mapgears.com/

#1352 From: "robbertouwehand" <robbert.ouwehand@...>
Date: Fri Jun 26, 2009 7:18 am
Subject: Re: Compiling Mitab on Visual C++ 2008 Express Edition (or VS Pro 2008)
robbertouwehand
Send Email Send Email
 
Hi Adeel,

That would be a perfect solution, since we only need to include the working
library in our project anyway.

Best regards,
Robbert

--- In mitab@yahoogroups.com, "adeel_razza" <adeel_razza@...> wrote:
>
> Hi Robert,
>
> I tried compiling Mitab on Visual C++ 2008 Express Edition first as well until
I realized that it only compiles on VC 6.0. If you don't have VC 6.0 I would be
happy to send you a compiled version of the library in a zip file. Let me know
if this would be a desirable solution.
>
> Regards,
> Adeel.
>
> --- In mitab@yahoogroups.com, "robbertouwehand" <robbert.ouwehand@> wrote:
> >
> > Hi there,
> >
> > I've been trying to get Mitab to compile on Visual C++ 2008 Express Edition
and on Visual Studio Professional 2008, but to no avail. I'll describe, step by
step, what I did.
> >
> > I first moved the SLN and the VCPROJ files to the MITab root folder. Then I
launched the project file, converted the SLN file so that Visual C++ 2008 EE
could work with it, altered the header files as described in
contrib/vcproj/README_VCPROJ.TXT.
> >
> > I first get 74 errors regarding vsnprintf. After commenting out #define
vsnprintf _vsnprintf in cpl_config.h, the compile fails because it can't read
MITab.def. I moved the MITab.def file to the MITab root folder and attempt to
recompile, but I get 43 linker errors of the following kind:
> >
> > 1>.\MITab.def(90) : warning LNK4017: Define statement not supported for the
target platform; ignored
> >
> > 1>cpl_csv.obj : error LNK2001: unresolved external symbol _CPLSetTLS
> >
> > All errors result from the unsupported define statements.
> >
> > What am I doing wrong?
> >
> > Best regards,
> > Robbert
> >
>

#1353 From: Anthony Dunk <anthonyd@...>
Date: Thu Jun 25, 2009 11:17 pm
Subject: Re: Re: Compiling Mitab on Visual C++ 2008 Express Edition (or VS Pro 2008)
anthonyd.rm
Send Email Send Email
 
I've been using Mitab for many years, first with VS6, then VS2005, and for the last year or so, VS2008. I haven't had any problems building it, but I create my own static library project and add the Mitab source files to it manually. If you have problems with the VCPROJ file provided, just create your own.
 
Also, in relation to the the linker problems reported in the other posting with using Mitab and GDAL together, there's two other solutions than the one Daniel put forward. You could change the function and class names in one of the projects and rebuild it (e.g. add an extra prefix to them all to avoid the clash), or you could try changing the order of the libs in your linker input settings, although I'm not sure that would help in this case.
 
Cheers,
Anthony.


From: Daniel Morissette <dmorissette@...>
To: mitab@yahoogroups.com
Sent: Friday, 26 June, 2009 5:46:37 AM
Subject: Re: [mitab] Re: Compiling Mitab on Visual C++ 2008 Express Edition (or VS Pro 2008)

adeel_razza wrote:
> Hi Robert,
>
> I tried compiling Mitab on Visual C++ 2008 Express Edition first as well until I realized that it only compiles on VC 6.0. If you don't have VC 6.0 I would be happy to send you a compiled version of the library in a zip file. Let me know if this would be a desirable solution.
>

The VCPROJ files may not work, but in case that helps, the makefile.vc
should work with VC++ 2008 Express Edition, that's what I use to produce
the releases.

Daniel
--
Daniel Morissette
http://www.mapgears .com/



Access Yahoo!7 Mail on your mobile. Anytime. Anywhere. Show me how.

#1354 From: "adeel_razza" <adeel_razza@...>
Date: Fri Jun 26, 2009 1:07 pm
Subject: Re: Compiling Mitab on Visual C++ 2008 Express Edition (or VS Pro 2008)
adeel_razza
Send Email Send Email
 
Hi Daniel,

Actually I used "makefile.vc" for Visual C++ 2008 Express Edition and I was
getting errors of duplicate definitions of "_vsnprintf" in stdio.h and some file
in the mitab source code. Then I installed VC6.0 on another machine and I used
the same makefile.vc and it worked without any problems. Maybe I missed a trick
in using the makefile.vc on Visual C++ 2008 Express Edition but I was definitely
getting errors when I tried compiling the library using VCVARS32.BAT and the
nmake utility.

Regards,
Adeel Raza.

--- In mitab@yahoogroups.com, Daniel Morissette <dmorissette@...> wrote:
>
> adeel_razza wrote:
> > Hi Robert,
> >
> > I tried compiling Mitab on Visual C++ 2008 Express Edition first as well
until I realized that it only compiles on VC 6.0. If you don't have VC 6.0 I
would be happy to send you a compiled version of the library in a zip file. Let
me know if this would be a desirable solution.
> >
>
> The VCPROJ files may not work, but in case that helps, the makefile.vc
> should work with VC++ 2008 Express Edition, that's what I use to produce
> the releases.
>
> Daniel
> --
> Daniel Morissette
> http://www.mapgears.com/
>

#1355 From: "rlcave3rd" <rlcave3rd@...>
Date: Tue Jun 30, 2009 4:11 pm
Subject: Option to suppress pen and brush info in MIF file?
rlcave3rd
Send Email Send Email
 
Hello,

Does MITAB have an option that can be used to suppress the pen and brush info
that is attached to lines and polygons in a MIF file?  We've had a customer
request this.

Thanks,

Bob

#1356 From: Daniel Morissette <dmorissette@...>
Date: Tue Jun 30, 2009 6:39 pm
Subject: Re: Option to suppress pen and brush info in MIF file?
dan_morissette
Send Email Send Email
 
rlcave3rd wrote:
> Hello,
>
> Does MITAB have an option that can be used to suppress the pen and brush info
that is attached to lines and polygons in a MIF file?  We've had a customer
request this.
>

There is no option in the tab2tab program to do this, so you'd need a
bit of coding to do it, either with the C API or with the C++ classes.

If this is just a one-shot deal, a simple hack to do what you want would
be to convert the dataset to MIF, then use "grep -v" to filter out the
PEN and BRUSH lines, and finally convert back to TAB:

e.g. something like this (untested):

tab2tab source.tab tmp.mif
grep -v "PEN(" tmp.mif > tmp2.mif
grep -v "BRUSH(" tmp2.mif > tmp.mif
rm tmp2.mif
tab2tab tmp.mif dest.tab

This is for Unix/Linux of course, but there are several places offering
Windows ports of Unix/Linux utilities including
http://gnuwin32.sourceforge.net/

Daniel
--
Daniel Morissette
http://www.mapgears.com/

#1357 From: "rlcave3rd" <rlcave3rd@...>
Date: Tue Jun 30, 2009 7:37 pm
Subject: Re: Option to suppress pen and brush info in MIF file?
rlcave3rd
Send Email Send Email
 
--- In mitab@yahoogroups.com, Daniel Morissette <dmorissette@...> wrote:
>
> There is no option in the tab2tab program to do this, so you'd need a
> bit of coding to do it, either with the C API or with the C++ classes.
>

It looks like calling ITABFeaturePen::SetPenPattern(0) and
ITABFeatureBrush::SetBrushPattern(0) will have the desired effect.

> If this is just a one-shot deal, a simple hack to do what you want would

Unfortunately, this is not the case, but the solution seems pretty simple.

Thanks for your quick reply.

Bob

#1358 From: "rechohfi" <rechohfi@...>
Date: Fri Aug 7, 2009 9:15 pm
Subject: GDAL 1.6.1 and MITAB 1.7.0
rechohfi
Send Email Send Email
 
MITAB is included with GDAL source in ../ogr/ogrsf_frnts/mitab

What do I need to do to compile GDAL 1.6.1 and have access to MITAB functions
while developing an application?

I've compiled GDAL 1.6.1 but do not have access to MITAB functions.

Thanks in advance,

Reinaldo

#1359 From: Alan Boudreault <aboudreault@...>
Date: Fri Aug 7, 2009 11:56 pm
Subject: Re: GDAL 1.6.1 and MITAB 1.7.0
aboudreault@...
Send Email Send Email
 
MITAB is compiled statically into gdal. You could compile mitab as a
library itself and you'll be able to use its functions.

Alan

rechohfi wrote:
>
>
> MITAB is included with GDAL source in ../ogr/ogrsf_ frnts/mitab
>
> What do I need to do to compile GDAL 1.6.1 and have access to MITAB
> functions while developing an application?
>
> I've compiled GDAL 1.6.1 but do not have access to MITAB functions.
>
> Thanks in advance,
>
> Reinaldo
>
>


--
Alan Boudreault
Mapgears
http://www.mapgears.com/

#1360 From: "rechohfi" <rechohfi@...>
Date: Sat Aug 8, 2009 4:37 pm
Subject: Re: GDAL 1.6.1 and MITAB 1.7.0
rechohfi
Send Email Send Email
 
I did compiled MITAB separately.  I tried the test program that comes as an
example with MITAB, but when trying to write the .tab files out they are empty. 
I can only write .mif/mid out.

I am trying to get a set of point features out in .tab.  Is there a complete
example that is better than the test program that comes with the library?

Also, I could not get MITAB to compile under MSVS2008 Pro.

Thanks in advance.

Reinaldo

--- In mitab@yahoogroups.com, Alan Boudreault <aboudreault@...> wrote:
>
> MITAB is compiled statically into gdal. You could compile mitab as a
> library itself and you'll be able to use its functions.
>
> Alan
>
> rechohfi wrote:
> >
> >
> > MITAB is included with GDAL source in ../ogr/ogrsf_ frnts/mitab
> >
> > What do I need to do to compile GDAL 1.6.1 and have access to MITAB
> > functions while developing an application?
> >
> > I've compiled GDAL 1.6.1 but do not have access to MITAB functions.
> >
> > Thanks in advance,
> >
> > Reinaldo
> >
> >
>
>
> --
> Alan Boudreault
> Mapgears
> http://www.mapgears.com/
>

#1361 From: "rechohfi" <rechohfi@...>
Date: Sat Aug 8, 2009 11:20 pm
Subject: Problem with Writing a .tab File with Point Feature
rechohfi
Send Email Send Email
 
Could anyone tell me what's wrong with the code below?  This is from the example
that comes with MITAB.

I am trying to write out a point feature in .tab format, but I get empty files
out.

If I specify .mif, I get the correct file out but I want .tab out.

Thanks in advance.

Reinaldo

#include <stdio.h>
#include <assert.h>
#include <string.h>
#include <stdlib.h>
#include "mitab_capi.h"

#ifndef NULL
#  define NULL 0
#endif
/********************************************************************/
/*                         WriteFile()                              */
/********************************************************************/

static void WriteFile( const char * pszDest, const char * pszMifOrTab )

{
     mitab_handle dataset;
     mitab_feature feature;
//    mitab_feature region, polyline, multipoint;
     double  x[100], y[100];
     int 	 field_index;

     dataset = mitab_c_create( pszDest, pszMifOrTab,
                               "CoordSys Earth Projection 1, 104",
                               90, -90, 180, -180 );

     if( dataset == NULL )
     {
         printf( "Failed to create %s file %s.\n%s\n",
                 pszMifOrTab, pszDest, mitab_c_getlasterrormsg() );
         return;
     }

/* ---------------------------------------------------------------- */
/*  Add a text, float and integer field.                            */
/* ---------------------------------------------------------------- */
     field_index = mitab_c_add_field( dataset, "TestInt",
                                      TABFT_Integer, 8, 0,
                                      1, 0 ); /* Indexed */
     assert( field_index == 0 );

     field_index = mitab_c_add_field( dataset, "TestFloat", TABFT_Float,
                                      12, 2, 0, 0 );
     assert( field_index == 1 );

     field_index = mitab_c_add_field( dataset, "TestString", TABFT_Char,
                                      10, 0, 0, 0 );
     assert( field_index == 2 );

/* ---------------------------------------------------------------- */
/*  Write a point.                                                  */
/* ---------------------------------------------------------------- */
     feature = mitab_c_create_feature( dataset, TABFC_Point );

     x[0] = 98;
     y[0] = 50;

     mitab_c_set_points( feature, 0, 1, x, y );
     mitab_c_set_symbol( feature, 41, 15, 255*256 );
     mitab_c_set_field( feature, 0, "100" );
     mitab_c_set_field( feature, 1, "100.5" );
     mitab_c_set_field( feature, 2, "12345678901234567890" );
     mitab_c_write_feature( dataset, feature );
     mitab_c_destroy_feature( feature );

mitab_c_close ( dataset );
}

/*******************************************************************/
/*                           main()                                */
/*******************************************************************/

void main( int nArgc, char ** papszArgv )

{
         WriteFile( "c:/fotos/test_out1.tab", "tab" );
		 exit( 0 );
}

#1362 From: "rechohfi" <rechohfi@...>
Date: Thu Aug 13, 2009 12:11 pm
Subject: Problem with Writing a .tab File with Point Feature
rechohfi
Send Email Send Email
 
Could anyone out there help to tell me what's wrong with the code below? This is
from the example
that comes with MITAB.

I am trying to write out a point feature in .tab format, but I get empty files
out.

If I specify .mif, I get the correct file out but I want .tab out.

Thanks in advance.

Reinaldo

#include <stdio.h>
#include <assert.h>
#include <string.h>
#include <stdlib.h>
#include "mitab_capi.h"

#ifndef NULL
# define NULL 0
#endif
/********************************************************************/
/* WriteFile() */
/********************************************************************/

static void WriteFile( const char * pszDest, const char * pszMifOrTab )

{
mitab_handle dataset;
mitab_feature feature;
// mitab_feature region, polyline, multipoint;
double x[100], y[100];
int field_index;

dataset = mitab_c_create( pszDest, pszMifOrTab,
"CoordSys Earth Projection 1, 104",
90, -90, 180, -180 );

if( dataset == NULL )
{
printf( "Failed to create %s file %s.\n%s\n",
pszMifOrTab, pszDest, mitab_c_getlasterrormsg() );
return;
}

/* ---------------------------------------------------------------- */
/* Add a text, float and integer field. */
/* ---------------------------------------------------------------- */
field_index = mitab_c_add_field( dataset, "TestInt",
TABFT_Integer, 8, 0,
1, 0 ); /* Indexed */
assert( field_index == 0 );

field_index = mitab_c_add_field( dataset, "TestFloat", TABFT_Float,
12, 2, 0, 0 );
assert( field_index == 1 );

field_index = mitab_c_add_field( dataset, "TestString", TABFT_Char,
10, 0, 0, 0 );
assert( field_index == 2 );

/* ---------------------------------------------------------------- */
/* Write a point. */
/* ---------------------------------------------------------------- */
feature = mitab_c_create_feature( dataset, TABFC_Point );

x[0] = 98;
y[0] = 50;

mitab_c_set_points( feature, 0, 1, x, y );
mitab_c_set_symbol( feature, 41, 15, 255*256 );
mitab_c_set_field( feature, 0, "100" );
mitab_c_set_field( feature, 1, "100.5" );
mitab_c_set_field( feature, 2, "12345678901234567890" );
mitab_c_write_feature( dataset, feature );
mitab_c_destroy_feature( feature );

mitab_c_close ( dataset );
}

/*******************************************************************/
/* main() */
/*******************************************************************/

void main( int nArgc, char ** papszArgv )

{
WriteFile( "c:/fotos/test_out1.tab", "tab" );
exit( 0 );
}

#1363 From: Daniel Morissette <dmorissette@...>
Date: Thu Aug 13, 2009 2:52 pm
Subject: Re: Problem with Writing a .tab File with Point Feature
dan_morissette
Send Email Send Email
 
rechohfi wrote:
> Could anyone out there help to tell me what's wrong with the code below? This
is from the example
> that comes with MITAB.
>
> I am trying to write out a point feature in .tab format, but I get empty files
> out.
>
> If I specify .mif, I get the correct file out but I want .tab out.
>

Reinaldo,

I just tried compiling your program and it does create a valid TAB file
with one feature in it. I'm not sure what to suggest other than
rerunning your test and making sure you are looking at the right file(s).

Daniel
--
Daniel Morissette
http://www.mapgears.com/

#1364 From: "o_damhsa" <o_damhsa@...>
Date: Fri Aug 28, 2009 12:37 pm
Subject: Open MapInfo file with Visual C++ Express
o_damhsa
Send Email Send Email
 
Hello,

Firstly, I should say I'm sorry if this is a double post but my computer hung on
the first send so I'm not sure if my message got sent.


I have been trying to use the mitab.dll from the website to create some MapInfo
files. I can create a basic .TAB file and close it but I can't seem to open
files of any type, even the one I've just created. The program doesn't crash it
just returns a Null handle. I would be greatfull for any help on this.

Thanks,
Anthony

extern "C"
#include <windows.h>
#include <process.h>
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <tchar.h>
#include <stdlib.h>
#include "mitab_capi.h"


#ifndef Null
#define Null 0
#endif

int main () {



/*Typedef the function*/


typedef mitab_handle(__stdcall *pfunc3)(const char *);
typedef void(__stdcall *pfunc)(mitab_handle);
typedef mitab_handle(__stdcall *pfunc2)(const char * ,const char * ,const char
*,double,double,double,double);
mitab_handle dataset;
mitab_handle dataset2;



/*A pointer to the function*/

pfunc2 mitabCreate;
pfunc mitabClose;
pfunc3 mitabOpen;


/*LoadLibrary*/

HINSTANCE hdll = LoadLibraryA("c:\\mitab.dll");

/*GetProcAddress*/
if(hdll != Null){

mitabOpen = (pfunc3)GetProcAddress(hdll,"_mitab_c_open@4");
mitabClose = (pfunc)GetProcAddress(hdll,"_mitab_c_close@4");
mitabCreate = ( pfunc2)GetProcAddress(hdll,"_mitab_c_create@44");

dataset = mitabCreate( "c:\\bob.tab", "",
"CoordSys Earth Projection 1, 104",
90, -90, 180, -180 );

mitabClose(dataset);


dataset2 = mitabOpen("c:\\bob.tab");

if(dataset2 == Null)
{
printf("Did not open file");
}

}
return 0;
}

#1365 From: Daniel Morissette <dmorissette@...>
Date: Fri Aug 28, 2009 2:08 pm
Subject: Re: Open MapInfo file with Visual C++ Express
dan_morissette
Send Email Send Email
 
o_damhsa wrote:
>
>
> I have been trying to use the mitab.dll from the website to create some
MapInfo files. I can create a basic .TAB file and close it but I can't seem to
open files of any type, even the one I've just created. The program doesn't
crash it just returns a Null handle. I would be greatfull for any help on this.
>

In your test you create a file but don't write any feature to it. Have
you tried with a file that contains some features?

Daniel
--
Daniel Morissette
http://www.mapgears.com/

#1366 From: "o_damhsa" <o_damhsa@...>
Date: Fri Aug 28, 2009 4:47 pm
Subject: Re: Open MapInfo file with Visual C++ Express
o_damhsa
Send Email Send Email
 
--- In mitab@yahoogroups.com, Daniel Morissette <dmorissette@...> wrote:
>
> o_damhsa wrote:
> >
> >
> > I have been trying to use the mitab.dll from the website to create some
MapInfo files. I can create a basic .TAB file and close it but I can't seem to
open files of any type, even the one I've just created. The program doesn't
crash it just returns a Null handle. I would be greatfull for any help on this.
> >
>
> In your test you create a file but don't write any feature to it. Have
> you tried with a file that contains some features?
>
> Daniel
> --
> Daniel Morissette
> http://www.mapgears.com/

I wrote some features to the file and it was able to open it fine after that.
Thank you very much for your quick reply.

Anthony

In case anyone is interested this is the code. To run it, I created an empty
project in Visual C++ Express and typed in the code.

extern "C"
#include <windows.h>
#include <process.h>
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <tchar.h>
#include <stdlib.h>
#include "mitab_capi.h"


#ifndef Null
#define Null 0
#endif

int main () {



/*Typedef the functions*/


typedef mitab_handle(__stdcall *pfunc3)(const char *); //mitabOpen
typedef int(__stdcall *pfunc4)( mitab_handle handle, const char * field_name,int
field_type, int width, int precision, int indexed, int unique );//mitab addField
typedef void(__stdcall *pfunc)(mitab_handle); //mitabClose
typedef mitab_handle(__stdcall *pfunc2)(const char * ,const char * ,const char
*,double,double,double,double);//mitabCreate
typedef int (__stdcall *pfunc7)( mitab_handle handle, mitab_feature feature
);//writeFeature
typedef void (__stdcall *pfunc6)( mitab_feature ); //destroy feature
typedef mitab_feature (__stdcall *pfunc5)( mitab_handle, int feature_type );
//createFeature
typedef void (__stdcall *pfunc10)( mitab_feature, int field_index, const char *
value ); //setField
typedef void (__stdcall *pfunc8)( mitab_feature feature, int part,int
vertex_count, double * x, double * y ); //setPoints
typedef void (__stdcall *pfunc9)( mitab_feature feature, int symbol_no, int
symbol_size, int symbol_color ); //setSymbol

mitab_handle dataset;
mitab_handle dataset2;
mitab_feature feature;
int field_index;
double x[100], y[100];

/*A pointer to the functions*/

pfunc2 mitabCreate;
pfunc mitabClose;
pfunc3 mitabOpen;
pfunc4 mitab_c_add_field;
pfunc5 mitab_c_create_feature;
pfunc6 mitab_c_destroy_feature;
pfunc7 mitab_c_write_feature;
pfunc8 mitab_c_set_points;
pfunc9 mitab_c_set_symbol;
pfunc10 mitab_c_set_field;


/*LoadLibrary*/

HINSTANCE hdll = LoadLibraryA("c:\\mitab.dll");

/*GetProcAddress*/
if(hdll != Null){

mitabOpen = (pfunc3)GetProcAddress(hdll,"_mitab_c_open@4");
mitabClose = (pfunc)GetProcAddress(hdll,"_mitab_c_close@4");
mitabCreate = ( pfunc2)GetProcAddress(hdll,"_mitab_c_create@44");
mitab_c_add_field = (pfunc4)GetProcAddress(hdll,"_mitab_c_add_field@28");
mitab_c_create_feature =
(pfunc5)GetProcAddress(hdll,"_mitab_c_create_feature@8");
mitab_c_destroy_feature =
(pfunc6)GetProcAddress(hdll,"_mitab_c_destroy_feature@4");
mitab_c_set_points = (pfunc8)GetProcAddress(hdll,"_mitab_c_set_points@20");
mitab_c_set_symbol = (pfunc9)GetProcAddress(hdll,"_mitab_c_set_symbol@16");
mitab_c_set_field = (pfunc10)GetProcAddress(hdll,"_mitab_c_set_field@12");
mitab_c_write_feature =(pfunc7)GetProcAddress(hdll,"_mitab_c_write_feature@8");





dataset = mitabCreate( "c:\\bob.tab", "",
"CoordSys Earth Projection 1, 104",
90, -90, 180, -180 );
//mitabClose(dataset);


field_index = mitab_c_add_field( dataset, "TestInt",
TABFT_Integer, 8, 0,
1, 0 ); /* Indexed */
assert( field_index == 0 );

field_index = mitab_c_add_field( dataset, "TestFloat", TABFT_Float,
12, 2, 0, 0 );
assert( field_index == 1 );

field_index = mitab_c_add_field( dataset, "TestString", TABFT_Char,
10, 0, 0, 0 );
assert( field_index == 2 );


feature = mitab_c_create_feature( dataset, TABFC_Point );

x[0] = 98;
y[0] = 50;

mitab_c_set_points( feature, 0, 1, x, y );
mitab_c_set_symbol( feature, 41, 15, 255*256 );
mitab_c_set_field( feature, 0, "100" );
mitab_c_set_field( feature, 1, "100.5" );
mitab_c_set_field( feature, 2, "12345678901234567890" );
mitab_c_write_feature( dataset, feature );
mitab_c_destroy_feature( feature );

mitabClose(dataset);

dataset2 = mitabOpen("c:\\bob.tab");

}
return 0;
	 }

#1367 From: "lourdhus" <lourdhus@...>
Date: Tue Sep 8, 2009 8:50 am
Subject: Is it possible converting a MIF file that has no MID file to TAB using Mitab?
lourdhus
Send Email Send Email
 
Hi,

I am creating a MIF from another input file. But I don't have any option to get
data for MID. The MIF also dont have any reference to MID columns. Now I'm
trying to convert this MIF file to Tab.
mitab_c_Open returns null if I provide this MIF as argument. When i tried with a
dummy MID file with some content. mitab_c_open method is returning properly.
Please suggest me a way where I could convert any MIF that don't have a MID
pair, using mitab

Thanks,
John

Messages 1338 - 1367 of 1437   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help