コード例 #1
0
ファイル: GeoJSONFeature.cs プロジェクト: flowmatters/Veneer
        public GeoJSONFeature(Node n,RiverSystemScenario scenario,bool useSchematicLocation)
        {           
            id = NodeURL(n);

            properties.Add("name",n.Name);
            properties.Add(FeatureTypeProperty, "node");
            Coordinate loc = n.location;
            var schematic = ScriptHelpers.GetSchematic(scenario);
            if (schematic != null)
            {
                PointF schematicLocation = SchematicLocationForNode(n, schematic);
                properties.Add("schematic_location",new double[] {schematicLocation.X,schematicLocation.Y});
                if (useSchematicLocation)
                    loc = new Coordinate(schematicLocation);
            }
            properties.Add(ResourceProperty,
                UriTemplates.Resources.Replace("{resourceName}", ResourceName(n)));

            geometry = new GeoJSONGeometry(loc);
        }
コード例 #2
0
ファイル: GeoJSONFeature.cs プロジェクト: flowmatters/Veneer
        public GeoJSONFeature(Link l, RiverSystemScenario scenario, bool useSchematicLocation)
        {
            id = LinkURL(l);
            properties.Add("name", l.Name);
            properties.Add(FeatureTypeProperty, "link");
            properties.Add("from_node", NodeURL(l.UpstreamNode));
            properties.Add("to_node", NodeURL(l.DownstreamNode));

            if (useSchematicLocation)
            {
                var schematic = ScriptHelpers.GetSchematic(scenario);
                if (scenario != null)
                {

                    geometry = new GeoJSONGeometry(SchematicLocationForNode(l.from,schematic),SchematicLocationForNode(l.to,schematic));
                    return;
                }
            }
            geometry = new GeoJSONGeometry(l, useSchematicLocation);
        }
コード例 #3
0
ファイル: GeoJSONFeature.cs プロジェクト: flowmatters/Veneer
 public GeoJSONFeature(GEORegion region, Dictionary<string,object> attributes)
 {
     geometry = new GeoJSONGeometry(region);
     foreach (var kvp in attributes)
     {
         properties.Add(kvp.Key,kvp.Value);
     }
 }
コード例 #4
0
ファイル: GeoJSONFeature.cs プロジェクト: flowmatters/Veneer
 public GeoJSONFeature(Catchment c,GEORegion region)
 {
     id = UriTemplates.Catchment.Replace("{catchmentId}", c.id.ToString());
     properties.Add("name", c.Name);
     properties.Add(FeatureTypeProperty,"catchment");
     properties.Add("link",LinkURL(c.DownstreamLink));
     geometry = new GeoJSONGeometry(region);
 }