[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [udig-devel] World Mercator with postgis
|
David Zwarg wrote:
Hi Jody,
Thanks for the response.
I am having difficulty adding my own SRID, and getting uDig to
recognize it. What I really want is to be able to support this in my
own custom application, but for now, I am running uDig from Eclipse --
I don't know if that changes things.
This is what I've done: I created a geometry table in PostGIS, and set
the SRID to 3395 (the SRID in PostGIS for "WGS 84 / World Mercator").
When I load the layer into uDig, the CRS is set to 4326. That didn't
work.
When you right click on the layer (or better yet go to the catalog and
find the table) and ask for more information what does it tell you? The
GeoTools library we use does go and check the WKT definition from postgis.
The definition of 4326 may match what you were trying to set up?
Next, I created a geometry table in PostGIS, and set the SRID to 41001
(the SRID in uDig for "WGS84 / Simple Mercator" -- this is nearly the
same, and would suit my purposes if it would work). When I load the
layer into uDig, the CRS is set to 4326.
For any definition that is not complete (say from a shapefile or
something) we try and look up the offical EPSG definition and find a
match; could this be what is happening to you?
I assumed that the problem was that PostGIS and uDig had to have the
same CRS in both their systems, so the SRID in the PostGIS
spatial_ref_sys table matches the EPSG code in uDig's Coordinate
System dialog. Sure enough, if I set the PostGIS spatial reference to
something else (for my test, I used EPSG:4269), then when it loads
into uDig, the CRS is set correctly.
Additionally, when I attempt to add the definition from PostGIS (the
srtext from the spatial_ref_sys table) for 3395 into the Custom CRS
box in uDig, I can press "Apply" and "OK" to my heart's content, but
the dialog never closes, and I can't get out of the dialog without
canceling.
The custom CRS dialog box is just consulting uDig internal list of
definitions; there are facilities for you to add more definitions to
uDig at a coding level (you can set up a little property file with
additional definitions). Before we go that far ... can you compare what
you are trying to do with the definition of 4326?
Please advise,
David
On Wed, Feb 11, 2009 at 6:42 PM, Jody Garnett <jody.garnett@xxxxxxxxx
<mailto:jody.garnett@xxxxxxxxx>> wrote:
Mark Leslie is the postgis guy I know these days and he can
confirm or deny what I say here :-)
You can add your own SRID codes to to PostGIS and define one th be
generic cartesian 2D if you like. UDig will pick up this WKT
definition and be fairly happy.
In uDig you click to change the projection; there are two tabs
(one where you select the formal epsg definition from a list; and
a second where you can type in your own WKT). You can also right
lick on a layer and "force" a change of projection (if the data
source is wrong for example - it does happen).
Mercator is supported in our referencing library so you should be
able to proceed resonably well. Normally PostGIS SRID codes line
up with the EPSG codes ...
Jody
David Zwarg wrote:
Hello,
I am wondering if there is a way to use the World Mercator
projection in PostGIS in uDig. I am unable to use either the
PostGIS (3395) or the uDig (41001) EPSG codes for world
mercator in my PostGIS layer -- they both show up as Generic
cartesian 2D. As soon as I attempt to add geometry and edit
geometry, uDig goes into an endless loop of
IllegalArgumentExceptions.
However, if I use an EPSG code that appears in BOTH postgis
and uDig, it seems to work alright. If there was a way to
represent Generic cartesian coordinates in PostGIS, that would
be preferable, but -1 causes this same
IllegalArgumentException spiral. Am I missing a general
projection that would be more suitable?
Also, during this experiment, I was unable to create a custom
CRS in the uDig map preferences, or by clicking on the button
in the status bar. How do you create a custom CRS from a
known WKT?
Thanks,
David
------------------------------------------------------------------------
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel
------------------------------------------------------------------------
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel