Creating a flat terrain in a specified projection

classic Classic list List threaded Threaded
2 messages Options
John Larring John Larring
Reply | Threaded
Open this post in threaded view
|

Creating a flat terrain in a specified projection

Hi,

I'd like to use osgEarth to create flat projected terrains, and I've only had partial success (used the
dc_state_plane.earth and arc_imagery_roads_utm.earth examples as reference).

First the partial success: I have to geotiffs in Transverse Mercator created by a proprietary mapping application, one for Europe and one for Croatia. My first attempt was to just use the Europe map and reproject it to a Polar Stereographic projection (just for the fun of it:), and it worked well. However, when I wanted to add a hires inset for Croatia, I got black "projection bands" around the Croatia inset:

<map name="europe_with_croatia" type="projected">

    <profile name="Europe Polar Stereographic">
        <srs>+proj=stere +lat_ts=60 +lat_0=90 +lon_0=10
        </srs>
        <xmin>-5330000</xmin><ymin>-6355000</ymin>
        <xmax>5330000</xmax><ymax>-375000</ymax>
    </profile>
   
   
    <image name="europe" driver="gdal">
        <url>eu_TransMerc.tif</url>
    </image>

    <image name="croatia" driver="gdal">
        <url>croatia_TransMerc.tif</url>
    </image>
   
    <cache type="tms" reproject_before_caching="true">
        <path>cache</path>
    </cache>
</map>

I thought that the problem might be that the src srs was other than WGS84 latlong, so I found pull up BlueMarble in WGS84 latlong:

<map name="bluemarble_flat" type="projected">

    <profile name="World Polar Stereographic">
        <srs>+proj=stere +lat_ts=60 +lat_0=90 +lon_0=10
        </srs>
        <xmin>-5330000</xmin><ymin>-6355000</ymin>
        <xmax>5330000</xmax><ymax>-375000</ymax>
    </profile>
   
   
    <image name="bluemarblewest" driver="gdal">
        <url>bm_west.tif</url>
    </image>

    <image name="bluemarbleeast" driver="gdal">
        <url>bm_east.tif</url>
    </image>
   
    <cache type="tms" reproject_before_caching="true">
        <path>cache</path>
    </cache>
   
</map>

However, creating any thing projected from this source failed with :

%osgviewer bluemarble_flat.earth
[osgEarth::GDAL] GDAL Driver found 1 files
  /centos5/home/john/osgEarth/bm_west.tif
[osgEarth::GDAL] GDAL Driver found 1 files
  /centos5/home/john/osgEarth/bm_east.tif
[osgEarth::MapNode] Couldn't get tile for 0_0_0_0

With a Croatia 30m resolution map in WGS84 latlong that I have, I don't get the error above, but osgEarth kills the resources on my machine. I hope you guys can give me some input.

I am using osgEarth 1.2 and osg 2.8

Best regards,
John

gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Creating a flat terrain in a specified projection

Hi John.

Ah, the dreaded Polar Stereographic projection. I know the banding of which you speak. GDAL has difficulties handling PS imagery when reprojecting - particularly when discontiguous regions come into play. At one point I started to build explicit PS support into osgEarth (you'll see it in the SpatialReference class) but never really completed it.

See if you have better luck with another projection.

Glenn
Glenn Waldron / Pelican Mapping