[Geoserver-users] Custom Projections

From: David Rush <david@anonymised.com>
Subject: [Geoserver-users] Custom Projections

[...]

Under the "demo" page's "Map Preview", my data looks okay.

With a simple OpenLayers setup my data is there but it's quite distorted.

If there is a working "demo" set then what are differences between
this "demo" and your "simple" set?
BTW, have a look in your GeoServer webapp directory, search for
"EPSG:900913" - that can give you a hint about where an how custom
projection should be defined.

WBR.

The fact is that I fought with custom projections last two days
(raster images in my case).
This is not an easy topic, an it covered with documentation poorly. :frowning:

Looks like your case is WFS usage.
And your case is some base layer in WGS84 projection (EPSG:4326) with
using layer in custom projection over this base layer.

Here is an example, where base layer is in the mercator projection,
and the feature layer had to be reprojected into WGS84 projection, so
note the 'projection' property defined in layer options:
----
var roads = new OpenLayers.Layer.WFS(
"Controlled Areas",
"/geoserver/wfs",
{
                   typename: 'PostGIS_test1:RestrictedArea_test',
               },
{
!!!>>> projection: "EPSG:4326",
typename: 'RestrictedArea_test',
featureNS: 'http://wg-aim.com',
extractAttributes: true,
                   styleMap: new
OpenLayers.StyleMap(getDefaultStyle(sld, "My Areas"))
}
);
            map.addLayers([gsat, roads]);
----

dixi

2009/5/12 David Rush <david@anonymised.com>:

Raja:

The differences I see are between using the "Map Preview" from my Geoserver's admin pages, and just a very simple OpenLayers-enabled web page.

My data is in a custom Albers projection.

I added my WKT to my epsg.properties (prepending my WKT with "100004=") file and bounced Tomcat. Then I went to each layer (FeatureType) and specified it to use SRS: 100004.

Using "Map Preview" on any of my 3 layers looks fine - the projection looks exactly as it should (curved lines of latitude, and the shape I'm used to).

However, when I point a simple OpenLayers-enabled web page at any of my layers, it's coming out with straight lines of latitude and stretched in the east/west dimension - I presume it's reprojecting to geographic - EPSG:4326. How can get generic (not part of Geoserver) OpenLayers to use my native projection? (Or should I find an OpenLayers list to ask that?)

Raja Kajiev ha scritto:

The fact is that I fought with custom projections last two days
(raster images in my case).
This is not an easy topic, an it covered with documentation poorly. :frowning:

If you figured it out, you can contribute better docs, we're always
happy when someone lends a hand :slight_smile:

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Yes, the deeper I dig into GS/OL the more I think of making some
HowToGeoserver.org :slight_smile:
May be later, when the GS team finish that great doc technology revolution. :slight_smile:

2009/5/12 Andrea Aime <aaime@anonymised.com>:

Raja Kajiev ha scritto:

The fact is that I fought with custom projections last two days
(raster images in my case).
This is not an easy topic, an it covered with documentation poorly. :frowning:

If you figured it out, you can contribute better docs, we're always
happy when someone lends a hand :slight_smile:

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Raja Kajiev ha scritto:

Yes, the deeper I dig into GS/OL the more I think of making some
HowToGeoserver.org :slight_smile:
May be later, when the GS team finish that great doc technology revolution. :slight_smile:

Actually the revolution is done and we're already gathering contributions in terms of tutorials and translations.
If you're interested into it pick a topic you like and provide a path
or a brand new page by attaching it to an improvement request in
jira.codehaus.org.

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.