AW: [mapserver-users] Problem with Russia polygon

Arnd Wippermann arnd.wippermann at web.de
Wed Jan 6 16:14:35 EST 2010


Hi,

Use ogr tools to convert the shapefile to mapinfo mif. Then you can look at
the coordinates for the polygons.

There are a couple of times with a longitude < -180.

179.999986 -89.99999999999992
-180.0000149999999 -89.99997799999991
-179.9994199999999 -84.42868099999998 

If you change them to -180 (i have tested with -179..... and it works,
perhaps -180 do not work) and convert the mapinfo file back to shape, then
your trouble should be vanished.

Arnd


-----Ursprüngliche Nachricht-----
Von: mapserver-users-bounces at lists.osgeo.org
[mailto:mapserver-users-bounces at lists.osgeo.org] Im Auftrag von Nelson
Correia
Gesendet: Dienstag, 5. Januar 2010 15:05
An: Rahkonen Jukka; Barend Köbben; Lime, Steve D (DNR); Andy Colson
Cc: mapserver-users at lists.osgeo.org
Betreff: RE: [mapserver-users] Problem with Russia polygon

The problem seems to be with the re-projection from 4326 to 900913, which
I'm doing with mapserver (hence, the map file configuration).

If I configure the mapfile to use 4326 and make a request in 4326, the
problem disappear. So, the re-projection to 900913 should be screwing the
polygons at the edges of the map. 
I tried to re-project the polygons with postgis (st_transform), but I got
the following error:

	ERROR:  transform: couldn't project point: -20 (tolerance condition
error)

Which I don't know the meaning.

In the project I'm doing, I have to use 900913, so, if anyone have some
ideas of how to solve this, they will be well appreciated.

Thanks,

Nelson

-----Original Message-----
From: Rahkonen Jukka [mailto:Jukka.Rahkonen at mmmtike.fi]
Sent: segunda-feira, 4 de Janeiro de 2010 22:03
To: Barend Köbben; Nelson Correia; Lime, Steve D (DNR); Andy Colson
Cc: mapserver-users at lists.osgeo.org
Subject: Re: [mapserver-users] Problem with Russia polygon

Hi,

Unfortunately the extents are OK and the problem is something more
complicated.  Extents are indeed in meters but that's how they must be
because the MAP level projection looks like this:

PROJECTION
"init=epsg:900913"
END


-Jukka Rahkonen-


-----Alkuperäinen viesti-----
Lähettäjä: mapserver-users-bounces at lists.osgeo.org puolesta: Barend Köbben
Lähetetty: ma 4.1.2010 22:52
Vastaanottaja: Nelson Correia; Lime, Steve D (DNR); Andy Colson
Kopio: mapserver-users at lists.osgeo.org
Aihe: Re: [mapserver-users] Problem with Russia polygon
 
You've got data that is in latlong (units decimal degrees) in your
shapefile, however in the EXTENT part of the map file you use 
    EXTENT -20037508 -13590765 20037508 11229864 Which are not latlomngs but
some projected coordinates, and
    UNITS meters

IN the LAYER you tell mapserver that its:
PROJECTION
            "proj=longlat"
            "datum=WGS84"
            "no_defs"
        END

These two are contradictory. You'll have to match the PROJECTION in the
LAYER to the actual projection and units (apparentlt these are correct) ,
and make sure the EXTENT is expressed in the same system. So best thing is
to set the EXTENT in latlons (as its the whole world -180 -90 180 90 is a
safe bet) and UNITS to degrees...


Yours,


--
Barend Köbben
Senior Lecturer
University of Twente, Faculty of Geo-Information Science and Earth
Observation (ITC) PO Box 6, 7500AA Enschede, The Netherlands
+31 (0)53 4874253




On 04-01-10 19:34, "Nelson Correia" <nelson-correia at telecom.pt> wrote:

> Here is the simplified shapefile, along with a mapfile that uses it:
> http://www.2shared.com/file/10449234/a18d6a03/countries.html
> 
> Nelson
> 
> -----Original Message-----
> From: Lime, Steve D (DNR) [mailto:Steve.Lime at state.mn.us]
> Sent: segunda-feira, 4 de Janeiro de 2010 17:28
> To: Nelson Correia; Barend Köbben; Andy Colson
> Cc: mapserver-users at lists.osgeo.org
> Subject: RE: [mapserver-users] Problem with Russia polygon
> 
> Would be interesting to get a copy of the data in shapefile format, plus
the
> mapfile that generates the error...
> 
> Steve
> 
> -----Original Message-----
> From: mapserver-users-bounces at lists.osgeo.org
> [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Nelson
Correia
> Sent: Monday, January 04, 2010 7:32 AM
> To: Barend Köbben; Andy Colson
> Cc: mapserver-users at lists.osgeo.org
> Subject: RE: [mapserver-users] Problem with Russia polygon
> 
> Hello,
> 
> All the russian polygons are valid (st_valid) and closed (st_closed). The
> problem seems to be in the vertical lines at 180º and -180º that divide
> certain areas of the country. It seems like when mapserver tries to draw
these
> lines, there's some kind of unknown behavior that make it draw horizontal
> lines instead, resulting in very strange polygons.
> 
> However, I have not solved the problem yet.
> 
> Nelson
> 
> -----Original Message-----
> From: Barend Köbben [mailto:kobben at itc.nl]
> Sent: sábado, 2 de Janeiro de 2010 15:33
> To: Andy Colson; Nelson Correia
> Cc: mapserver-users at lists.osgeo.org
> Subject: Re: [mapserver-users] Problem with Russia polygon
> 
> Hi,
> 
>> I guess to make a long story short, do you have any editors (like qgis)
that
>> you can use to see/edit the layer and make sure  each record is valid?
> You can use PostGIS's ST_IsValid() for that.
> 
> The problem of Nelson seems to me to be a 'dateline' problem: you have
> coordinates in latlon and some polygons are crossing the dateline (and/or
> the poles), therefore the coordinates' sign jumps from - to + (or from E
to
> W). If you then draw that in a Plate Carree 'projection (where latitudes
and
> longitudes are treated as if they were Cartesian coordinates , which they
> surely aren't: they are angles from the middle of the Earth!), then the
> polygon jumps from the extreme right to the extreme left of the picture...
> 
> 
> --
> Barend Köbben
> Senior Lecturer
> University of Twente, Faculty of Geo-Information Science and
> Earth Observation (ITC)
> PO Box 6, 7500AA Enschede, The Netherlands
> +31 (0)53 4874253
> 
> 
> 
> On 02-01-10 15:50, "Andy Colson" <andy at squeakycode.net> wrote:
> 
>> On 12/30/2009 11:14 AM, Nelson Correia wrote:
>>> Hello,
>>> 
>>> I¹m using shapefile world data from gadm.org (I¹ve had this same problem
>>> with other data sources too) and I¹m having a problem with the Russian
>>> polygon: mapserver draws some strange lines parallel to the equator,
>>> near the north pole (like you can see in the attached image).
>>> 
>>> Anyone had the same problem and knows how to solve it?
>>> 
>>> Thanks,
>>> 
>>> Nelson
>> 
>> I have no idea if this is the same problem, but I have run into weird
drawing
>> problems before.  I import shape files into PostGIS and then use
mapserver on
>> that.  I got a polygon layer that had an unclosed line (I guess that is a
>> good
>> way to describe it).  It pissed off mapserver.  I could run sql like:
>> 
>> select gid from layer where not ST_IsClosed(the_geom)
>> 
>> and it would pull it up.  The people that sent me the layer swore there
was
>> nothing wrong with it (they didn't see any error).
>> 
>> I guess to make a long story short, do you have any editors (like qgis)
that
>> you can use to see/edit the layer and make sure  each record is valid?
>> 
>> -Andy
>> _______________________________________________
>> mapserver-users mailing list
>> mapserver-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
> International Institute for Geo-Information Science and Earth Observation
> (ITC)
> Chamber of Commerce: 410 27 560
> 
> E-mail disclaimer
> The information in this e-mail, including any attachments, is intended for
the
> addressee only. If you are not the intended recipient, you are hereby
notified
> that any disclosure, copying, distribution or action in relation to the
> content of this information is strictly prohibited. If you have received
this
> e-mail by mistake, please delete the message and any attachment and inform
the
> sender by return e-mail. ITC accepts no liability for any error or
omission in
> the message content or for damage of any kind that may arise as a result
of
> e-mail transmission.
> 
> 
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
> 

Faculty of Geo-Information Science and Earth Observation (ITC)
University of Twente

E-mail disclaimer
The information in this e-mail, including any attachments, is intended for
the addressee only. If you are not the intended recipient, you are hereby
notified that any disclosure, copying, distribution or action in relation to
the content of this information is strictly prohibited. If you have received
this e-mail by mistake, please delete the message and any attachment and
inform the sender by return e-mail. ITC accepts no liability for any error
or omission in the message content or for damage of any kind that may arise
as a result of e-mail transmission.
_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users



_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users



More information about the mapserver-users mailing list