Unsupported Geometries in SQL Server 2008

285 views
Skip to first unread message

Kristi

unread,
May 5, 2011, 11:29:06 PM5/5/11
to MapInfo-L
Hi everyone,
 
I'm facing a problem when upload the street map with the large size from MIPro into SQL Server 2008 spatial. The message error is as follows :
System.FormatException: 24117 : The LineString input is not valid because it does not have enough distinct points. A LineString must have at least two distinct points.
From MIPro help that error appears because the map use geometries that are not supported by DBMS engine. I've checked one of the invalid records, just found the attribute, not be able to display the graphical. I think I need to save as the map without the unsupported geometries. 
 
Anyone can advise me how to query the unsupported geometries in MIPro, so I can remove them in once process due to a lot of records?
 
OR - Is it possible to change the invalid geometries to be made valid either in MIPro or SQL Server?
 
Any help would be greatly appreciated!
 
Thanks in advance!
 
Kristi

robert crossley

unread,
May 5, 2011, 11:42:20 PM5/5/11
to mapi...@googlegroups.com

Kristi,

 

You can query your table in MapInfo with

 

Select Str$(Obj) From Table Group By Col1

 

To get the types of geometries that you have.

 

SQL won’t import text or null objects.

 

You can select out those records without objects with Select * From table Where Not Obj

 

And perhaps delete these?


Rob

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

Kristi

unread,
May 6, 2011, 2:31:06 AM5/6/11
to mapi...@googlegroups.com
Hi Rob,
 
Thanks for your response.
 
I've tried to query the type of geometries, and it just contains LINE and POLYLINE, there is no TEXT or NULL object. I've selected out the records without objects as well, but no records were selected.
 
FYI - If I select an invalid record, I didn't see the object even open in the new map window, whereas from the type of geometry selected is line.
 
So how to know the records of the unsupported geometries? Any advice?
 
Kristi
 
 

--- On Thu, 5/5/11, robert crossley <rob...@wotzhere.com> wrote:

Peter Horsbøll Møller

unread,
May 6, 2011, 2:33:47 AM5/6/11
to mapi...@googlegroups.com
The problem could also be that you have plines with only one node in the MapInfo table.

You can find these records with the select statement:

Select * From Table Where Val(Str$(ObjectInfo(OBJ, 20))) = 1

Make sure that you remove the records without object using Robs  description before running this statement - otherwise it with fail when it reaches a record with not geographical object

Peter Horsbøll Møller
Pitney Bowes Business Insight - MapInfo


2011/5/6 robert crossley <rob...@wotzhere.com>

Kristi

unread,
May 6, 2011, 5:56:07 AM5/6/11
to mapi...@googlegroups.com
Hi Peter,
 
It could be. However the following statement doesn't work on my end. Do you have any advice? 
 
Select * From Table Where Val(Str$(ObjectInfo(OBJ, 20))) = 1
>> ObjectInfo: argument 2 out of range
 
I've selected out the records without objects as well, but no records were selected.
 
Kristi
 


--- On Fri, 6/5/11, Peter Horsbøll Møller <mapi...@horsboll-moller.dk> wrote:
--

Uffe Kousgaard

unread,
May 6, 2011, 6:27:39 AM5/6/11
to mapi...@googlegroups.com
Hi,

You can try our free toolbox and it's "extended table info" function:
http://www.routeware.dk/toolbox.php

Maybe it will tell you which kind of "odd" objects your table has.

Regards
Uffe Kousgaard


Kristi wrote:
Hi Peter,
�
It could be. However the following�statement doesn't work on my end. Do you have any advice?�
�
Select * From�Table Where Val(Str$(ObjectInfo(OBJ, 20))) = 1
>> ObjectInfo: argument 2 out of range
�
I've selected out the records without objects as well, but no records were selected.
�
Kristi
�


--- On Fri, 6/5/11, Peter Horsb�ll M�ller <mapi...@horsboll-moller.dk> wrote:

From: Peter Horsb�ll M�ller <mapi...@horsboll-moller.dk>
Subject: Re: [MI-L] Unsupported Geometries in SQL Server 2008
To: mapi...@googlegroups.com
Received: Friday, 6 May, 2011, 2:33 AM

The problem could also be that you have plines with only one node in the MapInfo table.

You can find these records with the select statement:

Select * From Table Where Val(Str$(ObjectInfo(OBJ, 20))) = 1

Make sure that you remove the records without object using Robs �description before running this statement - otherwise it with fail when it reaches a record with not geographical object

Peter Horsb�ll M�ller

Pitney Bowes Business Insight - MapInfo


2011/5/6 robert crossley <rob...@wotzhere.com>

Kristi,

�

You can query your table in MapInfo with

�

Select Str$(Obj) From Table Group By Col1

�

To get the types of geometries that you have.

�

SQL won�t import text or null objects.

�

You can select out those records without objects with Select * From table Where Not Obj

�

And perhaps delete these?


Rob

�

From: mapi...@googlegroups.com [mailto:mapi...@googlegroups.com] On Behalf Of Kristi
Sent: Friday, 6 May 2011 1:29 PM
To: MapInfo-L
Subject: [MI-L] Unsupported Geometries in SQL Server 2008

�

Hi everyone,

�

I'm facing a problem when upload the street map with the large size from MIPro into SQL Server 2008 spatial. The message error is as follows :

System.FormatException: 24117 : The LineString input is not valid because it does not have enough distinct points. A LineString must have at least two distinct points.

From MIPro help that error appears because the map use geometries that are not supported by DBMS engine. I've checked one of the invalid�records, just found the attribute, not be able to display the graphical. I think I need to save as the map without the unsupported geometries.�

�

Anyone can advise me how to query the unsupported geometries in MIPro, so I can remove them in once process due to a lot of records?

�

OR - Is it possible to change the invalid geometries to be made valid either in MIPro or SQL Server?

�

Any help would be greatly appreciated!

�

Thanks in advance!

�

Kristi

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

Thomas Bacon

unread,
May 6, 2011, 6:30:54 AM5/6/11
to mapi...@googlegroups.com

Kristi,

 

Could be because you have objects which aren’t polylines in your table, hence the ObjectInfo( ) function is causing an error. Try querying out all your polylines first and then running the select for single node polylines on your query results.

 

e.g.

 

Select * from Table where Str$(obj) = “Polyline” into PLines

 

Select * from PLines where Val(Str$(ObjectInfo(Obj,20))) = 1 

 

HTH,

 

Tom Bacon

Graduate GIS Engineer

Asset Management South

Tel: 01444 472380

www.mouchel.com

 




The information in this e-mail is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorised. Any views or opinions expressed in this e-mail may be solely those of the author and are not necessarily those of Mouchel. Mouchel Limited, Registered in England at Export House, Cawsey Way, Woking, Surrey, UK, GU21 6QX Registered No : 1686040

Andy Harfoot

unread,
May 6, 2011, 11:07:55 AM5/6/11
to mapi...@googlegroups.com
Hi Kristi,

It sounds like you may have degenerate lines or polylines in the dataset
(where the start and end points are in the same location and the line
length is zero). These may not be acceptable to SQL Server. To check do
the following:

If you select one of the invalid geometries and then try to view it in a
map window, you may not see it (as you describe below). With the record
selected in the map window though, press F7 to see the object geometry
information and if you see the dialog for a line object appear reporting
a length of 0 then it is a degenerate line.

You can select all degenerate lines using this query:
select * from Table where objectlen(obj,"m") = 0

Andy


Kristi wrote:
> Hi Rob,
>
> Thanks for your response.
>
> I've tried to query the type of geometries, and it just contains LINE
> and POLYLINE, there is no TEXT or NULL object. I've selected out the
> records without objects as well, but no records were selected.
>
> FYI - If I select an invalid record, I didn't see the object even open
> in the new map window, whereas from the type of geometry selected is line.
>
> So how to know the records of the unsupported geometries? Any advice?
>
> Kristi
>
>
>
> --- On *Thu, 5/5/11, robert crossley /<rob...@wotzhere.com>/* wrote:
>
>
> From: robert crossley <rob...@wotzhere.com>
> Subject: RE: [MI-L] Unsupported Geometries in SQL Server 2008
> To: mapi...@googlegroups.com
> Received: Thursday, 5 May, 2011, 11:42 PM
>
> Kristi,
>
>
>
> You can query your table in MapInfo with
>
>
>
> Select Str$(Obj) From Table Group By Col1
>
>
>
> To get the types of geometries that you have.
>
>
>
> SQL won’t import text or null objects.
>
>
>
> You can select out those records without objects with Select * From
> table Where Not Obj
>
>
>
> And perhaps delete these?
>
>
> Rob
>
>
>
>
>
>
>

> *From:* mapi...@googlegroups.com
> [mailto:mapi...@googlegroups.com] *On Behalf Of *Kristi
> *Sent:* Friday, 6 May 2011 1:29 PM
> *To:* MapInfo-L
> *Subject:* [MI-L] Unsupported Geometries in SQL Server 2008


>
>
>
> Hi everyone,
>
>
>
> I'm facing a problem when upload the street map with the large size
> from MIPro into SQL Server 2008 spatial. The message error is as
> follows :
>
> System.FormatException: 24117 : The LineString input is not
> valid because it does not have enough distinct points. A
> LineString must have at least two distinct points.
>
> From MIPro help that error appears because the map use geometries
> that are not supported by DBMS engine. I've checked one of the
> invalid records, just found the attribute, not be able to display
> the graphical. I think I need to save as the map without the
> unsupported geometries.
>
>
>
> Anyone can advise me how to query the unsupported geometries in
> MIPro, so I can remove them in once process due to a lot of records?
>
>
>
> OR - Is it possible to change the invalid geometries to be made
> valid either in MIPro or SQL Server?
>
>
>
> Any help would be greatly appreciated!
>
>
>
> Thanks in advance!
>
>
>
> Kristi
>
> --
> 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 *MailScanner has detected a possible fraud attempt from
> "au.mc380.mail.yahoo.com" claiming to be* mapi...@googlegroups.com
> <http://au.mc380.mail.yahoo.com/mc/compose?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 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 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


--
Andy Harfoot

GeoData Institute
University of Southampton
Southampton
SO17 1BJ

Tel: +44 (0)23 8059 2719
Fax: +44 (0)23 8059 2849

www.geodata.soton.ac.uk

---------------------------------------
For further information about GeoData's
Training Courses, please visit:
www.gis-train.com
---------------------------------------

Kristi

unread,
May 9, 2011, 1:23:26 AM5/9/11
to mapi...@googlegroups.com
Thanks Andy, Thomas, Peter, Uffe, and Rob.
 
Hi Andy,
 
Many thanks for your assistance, it works now. You are right that there are the degenerate lines in the dataset. I've deleted them and it can be uploaded to SQL'08. I'm happy. Just wondering - do you have an advice to query the degenerate polygon or region objects? I found the same problem with the other layer that contains polygons/regions.
 
Kristi
 


--- On Fri, 6/5/11, Andy Harfoot <aj...@geodata.soton.ac.uk> wrote:

Kristi

unread,
May 9, 2011, 2:01:06 AM5/9/11
to mapi...@googlegroups.com
Sorry, I've found the statement how to select all degenerate polygons :
Select * from Table where area(obj,"sq m") = 0 
 
Kristi
 

--- On Mon, 9/5/11, Kristi <kris...@yahoo.com> wrote:

Mike Osbourn

unread,
May 11, 2011, 8:04:43 PM5/11/11
to mapi...@googlegroups.com

Peter and all,

 

When loading tables into our Sql 08 backend it seemed a bit more finicky than even Spatialware.  Some polygon files resulted in showing a mixed table of lines and polygons where the native and Spatialware tables did not.  The only way I was able to “clean” the files was actually to do a query for the tables not containing polygons.  When attempting to query for all polygons and invert the result there were no records returned.

 

Just my 2 cents for anyone that might run into the same issues.

 

Mike

--

Lars I. Nielsen (GisPro)

unread,
May 12, 2011, 1:24:01 AM5/12/11
to mapi...@googlegroups.com
Hi Mike,

One new feature in the SQL 2008 support is the ability to have topologically "clean" tables, i.e. tables with only points, lines and regions resp.. This wasn't possible in SpatialWare.

It's also possible to have an "all-topologies" table, like SpatialWare (and Pro). It's controlled by the table type (17/17.1/17.2/17.3) in the MapCatalog.

That said, I've encountered "Collection" objects in my region tables (17.2), so it's not as clean-cut as it ought to be, imho. I need to do some investigation on those incidents.

So it sounds to me, that you either haven't utilized the "clean" table types, or are battling Collection objects same as me.


Best regards / Med venlig hilsen
Lars I. Nielsen
GIS & DB Integrator
GisPro

Kristi

unread,
May 12, 2011, 2:04:17 AM5/12/11
to mapi...@googlegroups.com
Hi Mike and Lars,
 
I've just found the same case as well. Some polygons resulted of 'lines' and polygons. When I did a query to get the types of geometries, there were region and 'Collection' objects in my region table. If I open one of the 'Collection' objects in the new map window, it reports region, polyline, and multipoint objects from the geometry information dialog.
 
Kristi
 


--- On Thu, 12/5/11, Lars I. Nielsen (GisPro) <L...@gispro.dk> wrote:
Reply all
Reply to author
Forward
0 new messages