MyMap.earth: file not handled

classic Classic list List threaded Threaded
21 messages Options
12
MarkL MarkL
Reply | Threaded
Open this post in threaded view
|

MyMap.earth: file not handled

I have just installed osgEarth and its prerequisites.  I've been attempting to build a .earth file that will load ESRI shapefiles; here's what I've hacked together so far based on the available documentation and examples I've seen:

<map name="MyMap">
    <model name="globe" driver = "feature_geom">
        <features name="shapefiles" driver="ogr">
            <url>/home/myuser/Documents/GSHHS/GSHHS_shp/f/GSHHS_f_L1.shp</url>
        </features>
    </model>
</map>

When I attempt to run the osgEarth_viewer program using the file, I get the message:

Error reading file /home/myuser/Documents/MyMap.earth: file not handled
[osgEarth]* [MapNodeHelper] Loaded scene graph does not contain a MapNode - aborting

I've probably missed something fundamental here.  Can anyone point me toward a solution?

Incidentally, I'm wondering if my GDAL installation is correct.  As far as I can determine, there aren't any special build settings for including the ESRI shape file driver, but I definitely could be wrong.  If somebody can provide a list of the specific build settings for GDAL with the ESRI shapefile driver enabled, I'd appreciate it.

GDAL version is 2.4.3; osgEarth version is 2.10.2
I'm running Centos 7 on an Alienware 17 R4 with 8 GB RAM and 2 TB SSD

Thanks in advance,
Mark
Mark
plevy plevy
Reply | Threaded
Open this post in threaded view
|

Re: MyMap.earth: file not handled

Hey MarkL,

Do the examples in osgearth/test folder work for you?  Maybe osgearth_viewer feature_country_boundaries.earth

--
Paul Levy : Pelican Mapping


On Mon, Nov 11, 2019 at 11:42 AM MarkL [via osgEarth] <[hidden email]> wrote:
I have just installed osgEarth and its prerequisites.  I've been attempting to build a .earth file that will load ESRI shapefiles; here's what I've hacked together so far based on the available documentation and examples I've seen:

<map name="MyMap">
    <model name="globe" driver = "feature_geom">
        <features name="shapefiles" driver="ogr">
            <url>/home/myuser/Documents/GSHHS/GSHHS_shp/f/GSHHS_f_L1.shp</url>
        </features>
    </model>
</map>

When I attempt to run the osgEarth_viewer program using the file, I get the message:

Error reading file /home/myuser/Documents/MyMap.earth: file not handled
[osgEarth]* [MapNodeHelper] Loaded scene graph does not contain a MapNode - aborting

I've probably missed something fundamental here.  Can anyone point me toward a solution?

Incidentally, I'm wondering if my GDAL installation is correct.  As far as I can determine, there aren't any special build settings for including the ESRI shape file driver, but I definitely could be wrong.  If somebody can provide a list of the specific build settings for GDAL with the ESRI shapefile driver enabled, I'd appreciate it.

GDAL version is 2.4.3; osgEarth version is 2.10.2
I'm running Centos 7 on an Alienware 17 R4 with 8 GB RAM and 2 TB SSD

Thanks in advance,
Mark
Mark



If you reply to this email, your message will be added to the discussion below:
http://forum.osgearth.org/MyMap-earth-file-not-handled-tp7592910.html
To start a new topic under osgEarth, email [hidden email]
To unsubscribe from osgEarth, click here.
NAML
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: MyMap.earth: file not handled

In reply to this post by MarkL
Mark,
Please read this thread, esp. towards the bottom. Hope this helps.

https://github.com/gwaldron/osgearth/issues/758

Glenn Waldron / Pelican Mapping
MarkL MarkL
Reply | Threaded
Open this post in threaded view
|

Re: MyMap.earth: file not handled

In reply to this post by plevy
Hi Paul,

Thanks for the speedy reply.  I get the same error message when I attempt to use feature_country_boundaries.earth with osgearth_viewer.
Mark
plevy plevy
Reply | Threaded
Open this post in threaded view
|

Re: MyMap.earth: file not handled

There are lots of users on various versions of Linux so guessing it is a build problem.  How about osgearth_featureinfo.exe file.shp

How did you install GDAL, did you build it?  Does ogrinfo file.shp work?

I haven't tried vcpkg on linux, but in theory, it works and would build all the dependencies and osgearth.  That might be one path which you can always just use the dependencies and build osgearth on your own.


--
Paul Levy : Pelican Mapping


On Mon, Nov 11, 2019 at 1:15 PM MarkL [via osgEarth] <[hidden email]> wrote:
Hi Paul,

Thanks for the speedy reply.  I get the same error message when I attempt to use feature_country_boundaries.earth with osgearth_viewer.
Mark



If you reply to this email, your message will be added to the discussion below:
http://forum.osgearth.org/MyMap-earth-file-not-handled-tp7592910p7592913.html
To start a new topic under osgEarth, email [hidden email]
To unsubscribe from osgEarth, click here.
NAML
MarkL MarkL
Reply | Threaded
Open this post in threaded view
|

Re: MyMap.earth: file not handled

In reply to this post by MarkL
One additional consideration:

While installing osgEarth, I was getting build errors linking libosgEarthFeatures.so due to an issue with protobufs.  Apparently the protobufs build did not use the -fPIC flag, and the osgEarth build complained about it.  I had read that protobufs was optional for osgEarth, so rather than attempt to rebuild protobufs with the -fPIC flag, I made the following change to src/osgEarthFeatures/CMakeLists.txt at around line 118:

#suppress protobuf inclusion
#IF(Protobuf_FOUND AND Protobuf_PROTOC_EXECUTABLE)
IF(0)


This change allowed libosgEarthFeatures.so to link properly.  Could it have had any side effects that would cause the problem I'm having?
Mark
MarkL MarkL
Reply | Threaded
Open this post in threaded view
|

Re: MyMap.earth: file not handled

In reply to this post by plevy
I built GDAL.  Not sure I built it correctly.

When I run ogrinfo against boston_buildings_utm19.shp I get the following output:

INFO: Open of '/home/myuser/Documents/osgEarth/data/boston_buildings_utm19.shp'
          using driver 'ESRI Shapefile' successful.
1: boston_buildings_utm19 (Polygon)

I get similar output when I open the .shp file I was originally trying to use; just a single polygon listed.  Is that the correct output?
Mark
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: MyMap.earth: file not handled

That means "layer 1".
Try ogrinfo -al

Glenn Waldron / Pelican Mapping
MarkL MarkL
Reply | Threaded
Open this post in threaded view
|

Re: MyMap.earth: file not handled

ogrinfo appears to work properly; I ran it out of the gdal-2.4.3/apps directory.

I've been away from Linux system maintenance for a few years, and I'm still catching up.  How do I determine of gdal installed properly?

Thanks,
Mark
Mark
MarkL MarkL
Reply | Threaded
Open this post in threaded view
|

Re: MyMap.earth: file not handled

In reply to this post by plevy
When I run osgearth_featureinfo I get the following:

Error reading file .osgearth_feature_ogr: file not handled
[osgEarth]* [FeatureSourceFactory] FAILED to load feature driver "ogr"
Segmentation fault (core dumped)

Mark
MarkL MarkL
Reply | Threaded
Open this post in threaded view
|

Re: MyMap.earth: file not handled

In reply to this post by gwaldron
Glenn,

Thanks for the link.  If I understood correctly, the takeaway from the link and its references is that the "-Wl,-E" flags need to be set when linking during the OpenSceneGraph and osgEarth builds.

I modified the CMakeLists.txt files in the top-level directory for both OpenSceneGraph and osgEarth to add the CMAKE_SHARED_LINKER_FLAGS and CMAKE_EXE_LINKER_FLAGS variables, and also added "-std=c++11" to the CMAKE_CXX_FLAGS variable which was required in order for OpenSceneGraph to build.

I still get the same error when I run osgearth_viewer.

However, I noted that when running cmake for osgEarth, cmake reports "Checking for C++11 compiler - unavailable".  I find this curious because I am able to specify the -std=c++11 option for CMAKE_CXX_FLAGS during the OpenSceneGraph build.

I suspect there's an issue in my build environment, but I haven't a clue what it could be.  Any ideas?
Mark
MarkL MarkL
Reply | Threaded
Open this post in threaded view
|

Re: MyMap.earth: file not handled

I should include that the compiler is GNU 4.8.5
Mark
MarkL MarkL
Reply | Threaded
Open this post in threaded view
|

Re: MyMap.earth: file not handled

Another mystery solved: apparently the check_for_cxx11_compiler macro in the CXX11.cmake module included in the build package checks for GCC 4.9.0 or greater to grade the compiler as cxx11-capable (presumably due to the 4.9.0 requirement called for in src/osgEarthDrivers/gltf/json.hpp).
Mark
MarkL MarkL
Reply | Threaded
Open this post in threaded view
|

Re: MyMap.earth: file not handled

I removed the modifications to the CMakeLists.txt files and defined the CMAKE_SHARED_LINKER_FLAGS and CMAKE_EXE_LINKER_FLAGS variables on the cmake command line, like I should have done in the first place.  I also installed the Developer Toolset 7 so now GCC is at version 7.3.1 and cmake indicates it has found support for C++11.

After rebuilding OpenSceneGraph and osgEarth (defining the CMAKE_ variables as described above) I still get the same error when I attempt to run osgearth_featureinfo (FAILED to load feature driver "ogr").  The source of this error is the FeatureSourceFactory::create function:

source = dynamic_cast<FeatureSource*>( object.release() );

source returns null, and then a segmentation fault occurs when calling source.release() on a null pointer.

In the stackoverflow thread that proposed the linker flag solution (https://stackoverflow.com/questions/2351786/dynamic-cast-fails-when-used-with-dlopen-dlsym) there is also mention of a RTLD_GLOBAL flag argument to dlopen; I haven't made any modifications to the source to try this.  However, it makes me wonder if it would be worthwhile trying to build a static version of OpenSceneGraph and osgEarth.  Opinions?
Mark
MarkL MarkL
Reply | Threaded
Open this post in threaded view
|

Re: MyMap.earth: file not handled

Update:  I build OpenSceneGraph and osgEarth statically, and osgearth_featureinfo failed with the same error.

I'm stumped.
Mark
MarkL MarkL
Reply | Threaded
Open this post in threaded view
|

Re: MyMap.earth: file not handled

In reply to this post by gwaldron
Hi Glenn,

I believe I've tried everything suggested in the threads you referenced regarding cmake flags.  I still get the same error.  Any other suggestions?

Thanks,
Mark
Mark
plevy plevy
Reply | Threaded
Open this post in threaded view
|

Re: MyMap.earth: file not handled

MarkL,

Do you have another similarly configured machine to try vcpkg?  If you get the same error, it might rule out a build problem as it is going to build all the dependencies.
 
--
Paul Levy : Pelican Mapping

On Mon, Nov 18, 2019 at 7:03 AM MarkL [via osgEarth] <[hidden email]> wrote:
Hi Glenn,

I believe I've tried everything suggested in the threads you referenced regarding cmake flags.  I still get the same error.  Any other suggestions?

Thanks,
Mark
Mark



If you reply to this email, your message will be added to the discussion below:
http://forum.osgearth.org/MyMap-earth-file-not-handled-tp7592910p7592934.html
To start a new topic under osgEarth, email [hidden email]
To unsubscribe from osgEarth, click here.
NAML
MarkL MarkL
Reply | Threaded
Open this post in threaded view
|

Re: MyMap.earth: file not handled

Hi Paul,

I don't have another machine.  Would it do me any good to install vcpkg on the one I've got?

Thanks,
Mark
Mark
plevy plevy
Reply | Threaded
Open this post in threaded view
|

Re: MyMap.earth: file not handled

Sure, that is fine. On Windows, vcpkg maintains its own build tree and I assume something similar happens on linux.

The gist of it is you build vcpkg first, then you can vcpkg install osgearth and it will go off and build osgearth and all the dependencies.  


--
Paul Levy : Pelican Mapping


On Mon, Nov 18, 2019 at 12:45 PM MarkL [via osgEarth] <[hidden email]> wrote:
Hi Paul,

I don't have another machine.  Would it do me any good to install vcpkg on the one I've got?

Thanks,
Mark
Mark



If you reply to this email, your message will be added to the discussion below:
http://forum.osgearth.org/MyMap-earth-file-not-handled-tp7592910p7592939.html
To start a new topic under osgEarth, email [hidden email]
To unsubscribe from osgEarth, click here.
NAML
MarkL MarkL
Reply | Threaded
Open this post in threaded view
|

Re: MyMap.earth: file not handled

Finally a happy ending to this thread.  After a total reinstall of Centos 7, the Nvidia driver, and all osgEarth dependencies, this problem goes away.  Hopefully the issues ahead of me will be a little easier to handle.  Many thanks to Paul and Glenn for alll of their help and patience!

Mark
Mark
12