TAB to sql server 2008

1,108 views
Skip to first unread message

Bob

unread,
Mar 10, 2009, 7:31:22 PM3/10/09
to MapInfo-L
Does anyone know of a tool that will translate a mapinfo TAB polygon
file to a sql server 2008 database? I could also do a two step
process if there was a shp file to sql server (ie TAB to SHP to sql
server).

I found the following site: http://www.sharpgis.net/page/SQL-Server-2008-Spatial-Tools.aspx

But it looks like the download is no longer working. Any help is
appreciated.

Thanks,
Bob

Ian Tidy

unread,
Mar 10, 2009, 8:33:27 PM3/10/09
to mapi...@googlegroups.com, Ian Tidy
Bob,

Safe FME (http://www.safe.com) will do this, also you could try the
open-source ORG tools.

Cheers Ian

______________________
Ian Tidy
GIS Analyst / Developer
Phone +64-6-835-7579 Ext. 8115
Fax +64-6-834-4195
Skype:ian.tidy.ncc
mailto:ia...@napier.govt.nz
http://www.napier.govt.nz | http://maps.napier.govt.nz
########################################################################
#############
This e-mail message has been scanned for Viruses and Content and cleared

by MailMarshal
########################################################################
#############
#####################################################################################
This e-mail message has been scanned for Viruses and Content and cleared
by MailMarshal
#####################################################################################

######################################################################
Attention:
This e-mail message and accompanying data may contain information that
is confidential and subject to legal privilege. Any information
provided is given in good faith. However unless specifically stated to
the contrary, Napier City Council accepts no liability for the
content of this e-mail or for the consequences of any action taken on
the basis of the information provided, unless that information is
subsequently confirmed in writing. If you are not the intended recipient,
you are notified that any use, dissemination, distribution or copying
of this message or data is prohibited. If you received this e-mail
message in error, please notify us immediately and erase all copies
of this message and attachments. Thank you.

Richard Greenwood

unread,
Mar 10, 2009, 10:11:24 PM3/10/09
to mapi...@googlegroups.com

I have used the sharpgis tool and it worked nicely. I just visited the
site and posted a message that their download link is broken.

Ian mentioned ogr2ogr - does it currently support MSSQL 2008?

Regards,
--
Richard Greenwood
richard....@gmail.com
www.greenwoodmap.com

geoscisoft

unread,
Mar 10, 2009, 10:23:04 PM3/10/09
to mapi...@googlegroups.com
Try the CodePlex website - http://sqlspatialtools.codeplex.com/

Ian Thomas - GeoSciSoft - Australia

-----Original Message-----
From: mapi...@googlegroups.com [mailto:mapi...@googlegroups.com] On
Behalf Of Bob
Sent: Wednesday, 11 March 2009 8:31 AM
To: MapInfo-L
Subject: [MI-L] TAB to sql server 2008


Robert Crossley

unread,
Mar 10, 2009, 11:13:26 PM3/10/09
to mapi...@googlegroups.com
We have cheated a bit and used Spatialware as a middle stage. If this is a
desirable option for anyone I can document the steps and give examples of
the stored procs.

R
No virus found in this incoming message.
Checked by AVG.
Version: 7.5.557 / Virus Database: 270.11.9/1993 - Release Date: 10/03/2009
7:19 AM


No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.557 / Virus Database: 270.11.9/1993 - Release Date: 10/03/2009
7:19 AM


Peter Horsbøll Møller

unread,
Mar 11, 2009, 3:46:57 AM3/11/09
to mapi...@googlegroups.com
MapInfo EasyLoader can also to the trick in the latest version (9.5.1):
 

Peter Horsbøll Møller
Pitney Bowes Business Insight - MapInfo
2009/3/11 Robert Crossley <rob...@agtrix.com>

Robert Crossley

unread,
Mar 11, 2009, 6:34:29 AM3/11/09
to mapi...@googlegroups.com

Fantastic.  This will make the whole process easier.

No virus found in this incoming message.
Checked by AVG.
Version: 7.5.557 / Virus Database: 270.11.9/1993 - Release Date: 10/03/2009 7:19 AM

Bob

unread,
Mar 12, 2009, 11:36:24 AM3/12/09
to MapInfo-L
I downloaded the latest version of Easyloader(9.5.1) but it still will
not work when I click upload and create a new table in sql server.
I'm trying to upload a polygon tab file to the server using easyloader
9.5.1, but I keep getting errors saying "failed to add user-
mapinfo. User does not have permission to perform this action."

Does this mean even the latest version of easyloader does not have
write capabilities for sql server 2008 or am I missing something else
having to deal with the map catalog? I even had MapInfo added as a
user on the server with dbo writes, but I still get the same error
message above.



On Mar 11, 12:46 am, Peter Horsbøll Møller <mapinf...@horsboll-
moller.dk> wrote:
> MapInfo EasyLoader can also to the trick in the latest version (9.5.1):www.mapinfo.com/easyloader
>
> Peter Horsbøll Møller
> Pitney Bowes Business Insight - MapInfo
> 2009/3/11 Robert Crossley <robe...@agtrix.com>
>
>
>
> > We have cheated a bit and used Spatialware as a middle stage.  If this is a
> > desirable option for anyone I can document the steps and give examples of
> > the stored procs.
>
> > R
>
> > -----Original Message-----
> > From: mapi...@googlegroups.com [mailto:mapi...@googlegroups.com] On
> > Behalf Of geoscisoft
> > Sent: Wednesday, 11 March 2009 1:23 PM
> > To: mapi...@googlegroups.com
> > Subject: [MI-L] Re: TAB to sql server 2008
>
> > Try the CodePlex website -http://sqlspatialtools.codeplex.com/

Ian Tidy

unread,
Mar 12, 2009, 3:22:55 PM3/12/09
to mapi...@googlegroups.com, Ian Tidy
EasyLoader requires a user called "MAPINFO" and creates a table MAPINFO.MAPINFO_MAPCATALOG to store details about each table loaded. The error is suggesting that it cannot create the user "MAPINFO". You can manually create this user without any problems.

Regards Ian

______________________
Ian Tidy
GIS Analyst / Developer
Works Asset Department
Napier City Council

ktg cad

unread,
Mar 16, 2009, 7:07:14 AM3/16/09
to mapi...@googlegroups.com
That was a good help!!!

Bob

unread,
Mar 16, 2009, 3:11:32 PM3/16/09
to MapInfo-L
I finally got Easyloader working to upload a polygon tab file. The
problem was the schema was dbo NOT MAPINFO. I ended up having to add
a new schema named MAPINFO. Then when it creates the MAP_CATALOG file
it is MAPINFO.MAPINFO_MAPCATALOG instead of dbo.MAPINFO_MAPCATALOG,
which didn't work.

I am however still getting errors on upload. For instance when I
upload the usa.tab table it only loads the first 6 records and stops
after Colorado. Below is the error I'm getting from the Easyloader
upload utility:

"insert failed for row: 7 - USA [Microsoft][SQL Server Native
Client 10.0][SQL Server]A .NET Framework error occurred during
execution of user-defined routine or aggregate "geography":
System.ArgumentException: 24200:The spcified input does not represent
a valid geography instance. Data Values: Connecticut."


I'm having this happen on other polygon tables also, where all the
rows are not being uploaded. I packed the tables before uploading to
make sure there was no empty rows in the table, but the error still
occurs and doesn't upload past a certain row. I do not get this when
uploading a point tab file so it must somehow be related to the
polygon shapes I'm guessing?



On Mar 12, 12:22 pm, "Ian Tidy" <I...@napier.govt.nz> wrote:
> EasyLoader requires a user called "MAPINFO" and creates a table MAPINFO.MAPINFO_MAPCATALOG to store details about each table loaded.  The error is suggesting that it cannot create the user "MAPINFO".  You can manually create this user without any problems.
>
> Regards Ian
>
> ______________________
> Ian Tidy
> GIS Analyst / Developer
> Works Asset Department
> Napier City Council
> mailto:i...@napier.govt.nzhttp://www.napier.govt.nz|http://maps.napier.govt.nz

Robert Crossley

unread,
Mar 16, 2009, 3:52:33 PM3/16/09
to mapi...@googlegroups.com
Try uploading it as a geometry rather than geography. There is a drop down
that allows you to override Easyoaders default for Spatial Custom Type.

R

-----Original Message-----
From: mapi...@googlegroups.com [mailto:mapi...@googlegroups.com] On
Behalf Of Bob
Sent: Tuesday, 17 March 2009 6:12 AM
To: MapInfo-L
Subject: [MI-L] Re: TAB to sql server 2008


> ######################################################################
> Attention:
> This e-mail message and accompanying data may contain information that
> is confidential and subject to legal privilege. Any information
> provided is given in good faith. However unless specifically stated to
> the contrary, Napier City Council accepts no liability for the
> content of this e-mail or for the consequences of any action taken on
> the basis of the information provided, unless that information is
> subsequently confirmed in writing. If you are not the intended recipient,
> you are notified that any use, dissemination, distribution or copying
> of this message or data is prohibited. If you received this e-mail
> message in error, please notify us immediately and erase all copies
> of this message and attachments. Thank you.

No virus found in this incoming message.
Checked by AVG.
Version: 7.5.557 / Virus Database: 270.11.15/2003 - Release Date: 15/03/2009
2:07 PM


No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.557 / Virus Database: 270.11.15/2003 - Release Date: 15/03/2009
2:07 PM


Richard Greenwood

unread,
Mar 16, 2009, 10:04:49 PM3/16/09
to mapinfo-l
On Mon, Mar 16, 2009 at 1:11 PM, Bob <rvder...@gmail.com> wrote:
>
> I finally got Easyloader working to upload a polygon tab file.  The
> problem was the schema was dbo NOT MAPINFO.  I ended up having to add
> a new schema named MAPINFO.  Then when it creates the MAP_CATALOG file
> it is MAPINFO.MAPINFO_MAPCATALOG instead of dbo.MAPINFO_MAPCATALOG,
> which didn't work.
>
> I am however still getting errors on upload.  For instance when I
> upload the usa.tab table it only loads the first 6 records and stops
> after Colorado.  Below is the error I'm getting from the Easyloader
> upload utility:
>
> "insert failed for row: 7 - USA    [Microsoft][SQL Server Native
> Client 10.0][SQL Server]A .NET Framework error occurred during
> execution of user-defined routine or aggregate "geography":
> System.ArgumentException: 24200:The spcified input does not represent
> a valid geography instance.  Data Values:  Connecticut."
>
>
> I'm having this happen on other polygon tables also, where all the
> rows are not being uploaded.  I packed the tables before uploading to
> make sure there was no empty rows in the table, but the error still
> occurs and doesn't upload past a certain row.  I do not get this when
> uploading a point tab file so it must somehow be related to the
> polygon shapes I'm guessing?

I found SQL Server 2008 was pretty particular about "valid" geometry.
Unfortunately I can't find my notes right now so apologies if my reply
is a bit vague. I used the sharpGIS Shape2Sql.exe. I converted my
MapInfo polygons to shape files and the used Shape2Sql to import them
into SQL Server 2008. Shape2Sql presented errors regarding invalid
geometries and offered the option to cancel or ignore. I selected
ignore. After the polys were in SQL Server 2008 I ran something like
"select * from polys where not IsValid(geom)" which produced the list
of polygons that SQL Server didn't like. I than ran something like
"update polys set geom = MakeValid(goem) where not IsValid(geom)'. In
my case, the invalid goemtries were irrelevant, like they were wound
the wrong direction or something trivial.

So my guess is that Easyloader is stopping on SQL Server invalid
geometries. And I really need to find my notes...

HTH,
Rich

Richard Greenwood

unread,
Mar 16, 2009, 10:24:57 PM3/16/09
to mapinfo-l
On Mon, Mar 16, 2009 at 8:04 PM, Richard Greenwood
<richard....@gmail.com> wrote:

> So my guess is that Easyloader is stopping on SQL Server invalid
> geometries. And I really need to find my notes...

Found my notes:

-- find invalid geometries
SELECT * from ownership where geom.STIsValid() <> 1;

SET @g = @g.MakeValid() -- Make them valid

Reply all
Reply to author
Forward
0 new messages