コード例 #1
0
        static XmlElement encodeResource(XmlDocument doc, Resource resource)
        {
            XmlElement e = null;

            if (resource && resource.getResourceType() != FeatureLayerResource.getStaticResourceType())
            {
                e = doc.CreateElement("", "resource", "");
                e.SetAttribute("type", resource.getResourceType());
                e.SetAttribute("name", resource.getName());
                string tags;
                foreach (string it in resource.getTags())
                {
                    tags += it + " ";
                }
                if (!string.IsNullOrEmpty(tags))
                {
                    e.SetAttribute("tags", tags);
                }

                e.AppendChild(encodeURI(doc, resource.getURI()));

                foreach (Property it in resource.getProperties())
                {
                    e.AppendChild(encodeProperty(doc, it));
                }

                if (resource.getResourceType() == SRSResource.getStaticResourceType())
                {
                    SRSResource srs = (SRSResource)resource;
                    e.AppendChild(doc.CreateTextNode(srs.getSRS().getWKT()));
                }
            }
            return(e);
        }
コード例 #2
0
 static void parseSRSResource(XmlElement e, SRSResource resource)
 {
     if (resource.getSRS() == null)
     {
         string wkt = e.InnerText;
         if (!string.IsNullOrEmpty(wkt))
         {
             resource.setSRS(Registry.SRSFactory().createSRSfromWKT(wkt));
         }
     }
 }
コード例 #3
0
 static void parseSRSResource(XmlElement e, SRSResource resource)
 {
     if (resource.getSRS() == null)
     {
         string wkt = e.InnerText;
         if (!string.IsNullOrEmpty(wkt))
         {
             SharpMapSpatialReferenceFactory shpsrsf = new SharpMapSpatialReferenceFactory();
             SpatialReference srs = shpsrsf.createSRSfromWKT(wkt);
             resource.setSRS(srs);
             //resource.setSRS(Registry.SRSFactory().createSRSfromWKT(wkt));
         }
     }
 }
コード例 #4
0
        static Terrain decodeTerrain(XmlElement e, Project proj)
        {
            Terrain terrain = null;

            if (e != null)
            {
                terrain = new Terrain();
                terrain.setBaseURI(proj.getBaseURI());
                terrain.setName(e.GetAttribute("name"));
                terrain.setURI(e.GetElementsByTagName("uri")[0].InnerText);

                SRSResource resource = findSRSResource(proj.getResources(), e.GetAttribute("srs"));
                if (resource != null)
                {
                    terrain.setExplicitSRS(resource.getSRS());
                }
            }
            return(terrain);
        }
コード例 #5
0
 static void parseSRSResource(XmlElement e, SRSResource resource)
 {
     if (resource.getSRS() == null)
     {
         string wkt = e.InnerText;
         if (!string.IsNullOrEmpty(wkt))
         {
             resource.setSRS(Registry.SRSFactory().createSRSfromWKT(wkt));
         }
     }
 }
コード例 #6
0
 static void parseSRSResource(XmlElement e, SRSResource resource)
 {
     if (resource.getSRS() == null)
     {
         string wkt = e.InnerText;
         if (!string.IsNullOrEmpty(wkt))
         {
             SharpMapSpatialReferenceFactory shpsrsf = new SharpMapSpatialReferenceFactory();
             SpatialReference srs = shpsrsf.createSRSfromWKT(wkt);
             resource.setSRS(srs);
             //resource.setSRS(Registry.SRSFactory().createSRSfromWKT(wkt));
         }
     }
 }