Package org.vfny.geoserver.wms.responses.featureInfo

Examples of org.vfny.geoserver.wms.responses.featureInfo.FeatureTemplate


        FeatureCollection<SimpleFeatureType, SimpleFeature> fc = source.getFeatures();
        Iterator i = fc.iterator();
        try {
            SimpleFeature f = (SimpleFeature) i.next();
           
            FeatureTemplate template = new FeatureTemplate();
            try {
                template.description( f );   
            }
            catch ( Exception e ) {
                e.printStackTrace();
                fail("template threw exception on null value");
            }
View Full Code Here


        FeatureCollection<SimpleFeatureType, SimpleFeature> fc = source.getFeatures();
        Iterator i = fc.iterator();
        try {
            SimpleFeature f = (SimpleFeature) i.next();

            FeatureTemplate template = new FeatureTemplate();
            try {
                template.template(f, "rawValues.ftl", FeatureTemplateTest.class);
            } catch (Exception e) {
                e.printStackTrace();
                throw(e);
            }
        } finally {
View Full Code Here

        FeatureCollection<SimpleFeatureType, SimpleFeature> fc = source.getFeatures();
        Iterator i = fc.iterator();
        try {
            SimpleFeature f = (SimpleFeature) i.next();
           
            FeatureTemplate template = new FeatureTemplate();
            template.description( f );
           
            //set a value to null
            f.setAttribute(1,null);
            try {
                template.description( f );   
            }
            catch ( Exception e ) {
                e.printStackTrace();
                fail("template threw exception on null value");
            }
View Full Code Here

       
        FeatureSource<SimpleFeatureType, SimpleFeature> source = getFeatureSource( MockData.PRIMITIVEGEOFEATURE );
        FeatureCollection<SimpleFeatureType, SimpleFeature> fc = source.getFeatures();
        SimpleFeature f = fc.features().next();
       
        FeatureTemplate template = new FeatureTemplate();
        String result = template.template(f, "dummy.ftl", Dummy.class );
       
        assertEquals( "dummy", result );
    }
View Full Code Here

        resp.setEntity(format.toRepresentation(buildContext(namespace, f)));
    }

    private Map buildContext(String namespace, SimpleFeature f) {
        Map m = new HashMap();
        FeatureTemplate t = new FeatureTemplate();
       
        m.put(
                "typeName",
                namespace 
                + ":"
                + f.getType().getName().getLocalPart()
             );

        m.put("kmllink", buildURL(GEOSERVER_BASE_URL, f.getIdentifier().toString() + "_goto.kml", null, URLType.SERVICE));
       
        m.put("rawkmllink",  buildURL(GEOSERVER_BASE_URL,  f.getIdentifier().toString() + ".kml?raw=true", null, URLType.SERVICE));
       
        try {
            m.put("name", t.title(f));
        } catch (IOException e) {
            m.put("name", f.getIdentifier().toString());
        }

        try {
            m.put("description", t.description(f));
        } catch (IOException e) {
            m.put("description", "");
        }

        return m;
View Full Code Here

TOP

Related Classes of org.vfny.geoserver.wms.responses.featureInfo.FeatureTemplate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.