Can't grok content

classic Classic list List threaded Threaded
14 messages Options
andreahmed andreahmed
Reply | Threaded
Open this post in threaded view
|

Can't grok content

hi,
I'm trying to use the featuresource options WFS, and I get the message can not grok contents, error reading wfs response. What does this mean ? What should I change on the server to read WFS contents  that matches with OSGearth ?
andreahmed andreahmed
Reply | Threaded
Open this post in threaded view
|

Re: Can't grok content

I fixed it, I wrote the namespace wrong.

Now I have another problem, In feature profile

featureProfile->getMaxLevel

Max level and low level are wrong values, they are not set. What are the things that should be in the server to get the max and low levels, what are those values ?
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Can't grok content

Ahmed,
I don't think WMS supports a "max level" parameter, so that's why the values are unset. There is no concept of zoom levels in WMS. This concept generally only applies to pre-tiled data sources like TMS or TFS.

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

Re: Can't grok content

I'm using WFS not WMS.


1) problem 1, I have another database in which osgearth crashes, because it can't get max level.

2) problem 2, I have also another problem. Everything is alright, I can connect to the WFS server, I get the features,..etc from another database.

but it says Can not create spatial reference 31467 and nothing is rendered on the screen.
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Can't grok content

Sorry, I misread it. But I think the same answer applies to WFS. In any case you'll need to post your earth file snippet or stack trace for help with a crash. Thanks.
Glenn Waldron / Pelican Mapping
andreahmed andreahmed
Reply | Threaded
Open this post in threaded view
|

Re: Can't grok content



Kindly find attached image where the crash is
andreahmed andreahmed
Reply | Threaded
Open this post in threaded view
|

Re: Can't grok content

code is

The problem is in this line:

 _lodmap.resize(featureProfile->getMaxLevel() + 1);


It can resize the vector because the value is negative of getMaxLevel();



// Create the WFS driver:
     osgEarth::Drivers::WFSFeatureOptions wfs;

     wfs.url() = osgEarth::URI("http://192.168.139.129/cgi-bin/tinyows.exe");
     wfs.typeName() = "tows:frida";
     wfs.outputFormat() = "JSON";     // JSON or GML
   
 
                                      // Configure a rendering style:
     Style style;
     style.setName("frida");

     LineSymbol* line = style.getOrCreate<LineSymbol>();
     line->stroke()->color() = Color::Yellow;
     line->stroke()->width() = 5.0f;
     line->stroke()->widthUnits() = Units::PIXELS;

     AltitudeSymbol* alt = style.getOrCreate<AltitudeSymbol>();
     alt->clamping() = AltitudeSymbol::CLAMP_TO_TERRAIN;
     alt->technique() = AltitudeSymbol::TECHNIQUE_DRAPE;

     // Configure a model layer to render the features:
     osgEarth::Drivers::FeatureGeomModelOptions geom;
     geom.featureOptions() = wfs;
     geom.styles() = new StyleSheet();
     geom.styles()->addStyle(style);

     // Make the new layer and add it to the map.
     ModelLayerOptions layerOptions("frida", geom);
     ModelLayer* layer = new ModelLayer(layerOptions);
     mapNode->getMap()->addModelLayer(layer);

     viewer.setSceneData(mapNode);

    viewer.setThreadingModel(osgViewer::Viewer::SingleThreaded);
    viewer.setSceneData(root);
    viewer.setUpViewInWindow(50, 50, 800, 600);
    viewer.realize();
    viewer.addEventHandler(new osgViewer::StatsHandler);
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Can't grok content

Well, something more insidious is happening, because for a normal WFS server you should never enter that code block (because getTiled() will be false). getTiled() can only be true for a TFS server, or if you somehow got a <tiled>true</true> block in your WFS Capabilities.
Glenn Waldron / Pelican Mapping
andreahmed andreahmed
Reply | Threaded
Open this post in threaded view
|

RE: Can't grok content

I called getCapabilities and It does not have tiled<true>. That’s so weird.

 

The other problem is nothing is shown on the map and it says unable to create spatial reference 31467

 

 

 

 

From: gwaldron [via osgEarth] [mailto:ml-node+[hidden email]]
Sent: Wednesday, February 08, 2017 3:26 PM
To: Ahmed Tolba
Subject: Re: Can't grok content

 

Well, something more insidious is happening, because for a normal WFS server you should never enter that code block (because getTiled() will be false). getTiled() can only be true for a TFS server, or if you somehow got a <tiled>true</true> block in your WFS Capabilities.

Glenn Waldron / Pelican Mapping / @glennwaldron

 


If you reply to this email, your message will be added to the discussion below:

http://forum.osgearth.org/Can-t-grok-content-tp7590444p7590454.html

To unsubscribe from Can't grok content, click here.
NAML

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

RE: Can't grok content

In reply to this post by gwaldron

I disabled the tiling  using wfs feature options and now everything is working. But nothing is displayed.

 

Here is my layer

 

Attached

 

 

Here is my code:

// Create the WFS driver:

     osgEarth::Drivers::WFSFeatureOptions wfs;

 

     wfs.url() = osgEarth::URI("http://192.168.139.129/cgi-bin/tinyows.exe");

     wfs.typeName() = "tows:frida";

     wfs.outputFormat() = "JSON";     // JSON or GML

     wfs.disableTiling()="true";

   

  

                                      // Configure a rendering style:

     Style style;

     style.setName("frida");

 

     LineSymbol* line = style.getOrCreate<LineSymbol>();

     line->stroke()->color() = Color::Yellow;

     line->stroke()->width() = 1500.0f;

     line->stroke()->widthUnits() = Units::METERS;

 

     AltitudeSymbol* alt = style.getOrCreate<AltitudeSymbol>();

     alt->clamping() = AltitudeSymbol::CLAMP_TO_TERRAIN;

     alt->technique() = AltitudeSymbol::TECHNIQUE_DRAPE;

 

     // Configure a model layer to render the features:

     osgEarth::Drivers::FeatureGeomModelOptions geom;

     geom.featureOptions() = wfs;

     geom.styles() = new StyleSheet();

     geom.styles()->addStyle(style);

 

     // Make the new layer and add it to the map.

     ModelLayerOptions layerOptions("frida", geom);

     ModelLayer* layer = new ModelLayer(layerOptions);

     mapNode->getMap()->addModelLayer(layer);

    

 

     viewer.setSceneData(mapNode);

 

    viewer.setThreadingModel(osgViewer::Viewer::SingleThreaded);

    viewer.setSceneData(root);

    viewer.setUpViewInWindow(50, 50, 800, 600);

    viewer.realize();

    viewer.addEventHandler(new osgViewer::StatsHandler);

 

 

 

From: gwaldron [via osgEarth] [mailto:ml-node+[hidden email]]
Sent: Wednesday, February 08, 2017 3:26 PM
To: Ahmed Tolba
Subject: Re: Can't grok content

 

Well, something more insidious is happening, because for a normal WFS server you should never enter that code block (because getTiled() will be false). getTiled() can only be true for a TFS server, or if you somehow got a <tiled>true</true> block in your WFS Capabilities.

Glenn Waldron / Pelican Mapping / @glennwaldron

 


If you reply to this email, your message will be added to the discussion below:

http://forum.osgearth.org/Can-t-grok-content-tp7590444p7590454.html

To unsubscribe from Can't grok content, click here.
NAML


Untitled.png (55K) Download Attachment
andreahmed andreahmed
Reply | Threaded
Open this post in threaded view
|

RE: Can't grok content

In reply to this post by andreahmed
I disabled the tiling  using wfs feature options and now everything is working. But nothing is displayed.

Here is my layer

Attached


Here is my code:
// Create the WFS driver:
     osgEarth::Drivers::WFSFeatureOptions wfs;

     wfs.url() = osgEarth::URI("http://192.168.139.129/cgi-bin/tinyows.exe");
     wfs.typeName() = "tows:frida";
     wfs.outputFormat() = "JSON";     // JSON or GML
     wfs.disableTiling()="true";
   
 
                                      // Configure a rendering style:
     Style style;
     style.setName("frida");

     LineSymbol* line = style.getOrCreate<LineSymbol>();
     line->stroke()->color() = Color::Yellow;
     line->stroke()->width() = 1500.0f;
     line->stroke()->widthUnits() = Units::METERS;

     AltitudeSymbol* alt = style.getOrCreate<AltitudeSymbol>();
     alt->clamping() = AltitudeSymbol::CLAMP_TO_TERRAIN;
     alt->technique() = AltitudeSymbol::TECHNIQUE_DRAPE;

     // Configure a model layer to render the features:
     osgEarth::Drivers::FeatureGeomModelOptions geom;
     geom.featureOptions() = wfs;
     geom.styles() = new StyleSheet();
     geom.styles()->addStyle(style);

     // Make the new layer and add it to the map.
     ModelLayerOptions layerOptions("frida", geom);
     ModelLayer* layer = new ModelLayer(layerOptions);
     mapNode->getMap()->addModelLayer(layer);
     

     viewer.setSceneData(mapNode);

    viewer.setThreadingModel(osgViewer::Viewer::SingleThreaded);
    viewer.setSceneData(root);
    viewer.setUpViewInWindow(50, 50, 800, 600);
    viewer.realize();
    viewer.addEventHandler(new osgViewer::StatsHandler);

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

Re: Can't grok content

In reply to this post by andreahmed
I ran into this problem recently reading from mapserver WFS.  I traced the error back to the FeatureSourceWFS.cpp file in "createURL".  I thought I had reported this a while back but must have forgot to.  Also this may be a difference between Geoserver and mapserver as a data source.  When "SERVICE=WFS" is appended to the url passed it there is a question mark (?) before the word SERVICE that should an ampersand (&).  After I changed that I could get valid WFS data

Bruce
andreahmed andreahmed
Reply | Threaded
Open this post in threaded view
|

RE: Can't grok content

Hi Bruce,

 

I’m getting a valid WFS data using the ? if I use ampersand I don’t get valid data.  The problem is in rendering. I used QGis and it worked and it showed the data. But in OSGEarth I don’t see any data.

 

Ahmed

 

From: Bruce [via osgEarth] [mailto:ml-node+[hidden email]]
Sent: Wednesday, February 08, 2017 5:19 PM
To: Ahmed Tolba
Subject: Re: Can't grok content

 

I ran into this problem recently reading from mapserver WFS.  I traced the error back to the FeatureSourceWFS.cpp file in "createURL".  I thought I had reported this a while back but must have forgot to.  Also this may be a difference between Geoserver and mapserver as a data source.  When "SERVICE=WFS" is appended to the url passed it there is a question mark (?) before the word SERVICE that should an ampersand (&).  After I changed that I could get valid WFS data

Bruce


If you reply to this email, your message will be added to the discussion below:

http://forum.osgearth.org/Can-t-grok-content-tp7590444p7590460.html

To unsubscribe from Can't grok content, click here.
NAML

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

RE: Can't grok content

Hi Bruce,

I’m getting a valid WFS data using the ? if I use ampersand I don’t get valid data.  The problem is in rendering. I used QGis and it worked and it showed the data. But in OSGEarth I don’t see any data.

Ahmed