Displaying the content of a KML file on a World Wind globe

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Displaying the content of a KML file on a World Wind globe

b.herd
Hi, 
 
I would like to visualise a city model in Repast on a World Wind globe. As far as I understand from the Geography example, I should create an agent and associate it with a style class implements  'SurfaceShapeStyle'. For that reason, I created a 'CityModel' with a corresponding 'CityModelStyle' class that implements 'SurfaceShapeStyle', as shown below.
 
public class CityModelStyle implements SurfaceShapeStyle<CityModel> {
    
    @Override
    public SurfaceShape getSurfaceShape(CityModel object, SurfaceShape shape) {
        String kmlFile = "cityModel.kml";
        try {
            KMLRoot kmlRoot = KMLRoot.createAndParse(kmlFile);
            // WHAT DO I HAVE TO DO HERE??
        } catch (IOException e) {
            e.printStackTrace();
        } catch (XMLStreamException e) {
            e.printStackTrace();
        }
        return null;
    }
...
}
 
Am I on the right track? If yes, what do I need to do in the lines below the call to 'createAndParse' in order to turn the KMLRoot object into an appropriate surface shape? I couldn't find any information on how to accomplish that, unfortunately. 
 
Apologies if that's a silly question, I'm still learning the internals of Repast. 
 
Many thanks,
Ben
 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Displaying the content of a KML file on a World Wind globe

Tatara, Eric R.

Repast does not support KML.  You would need to use some KML library to parse the file to create the agents.  I suppose you could also do this for the styles in the KML, but I would simply encode the agent styles manually rather than use the KML file.

 

eric

 

From: [hidden email] [mailto:[hidden email]]
Sent: Thursday, June 15, 2017 8:50 AM
To: [hidden email]
Subject: [Repast-interest] Displaying the content of a KML file on a World Wind globe

 

Hi, 

 

I would like to visualise a city model in Repast on a World Wind globe. As far as I understand from the Geography example, I should create an agent and associate it with a style class implements  'SurfaceShapeStyle'. For that reason, I created a 'CityModel' with a corresponding 'CityModelStyle' class that implements 'SurfaceShapeStyle', as shown below.

 

public class CityModelStyle implements SurfaceShapeStyle<CityModel> {
    
    @Override
    public SurfaceShape getSurfaceShape(CityModel object, SurfaceShape shape) {
        String kmlFile = "cityModel.kml";
        try {
            KMLRoot kmlRoot = KMLRoot.createAndParse(kmlFile);

            // WHAT DO I HAVE TO DO HERE??
        } catch (IOException e) {
            e.printStackTrace();
        } catch (XMLStreamException e) {
            e.printStackTrace();
        }
        return null;
    }

...

}

 

Am I on the right track? If yes, what do I need to do in the lines below the call to 'createAndParse' in order to turn the KMLRoot object into an appropriate surface shape? I couldn't find any information on how to accomplish that, unfortunately. 

 

Apologies if that's a silly question, I'm still learning the internals of Repast. 

 

Many thanks,

Ben

 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Loading...