private void initSearch() { var list = PointsTypes.getNames(); allowedTypes.AddRange(list.ToArray()); SearchByName.AutoCompleteCustomSource = allowedTypes; }
public string findObject(Point point) { GeoAPI.Geometries.Coordinate pt = _sharpMap.ImageToWorld(point); string PointQ = "POINT(" + pt.X + " " + pt.Y + ")"; var placeQuery = " AND ST_DWithin(geom, ST_GeomFromText('" + PointQ + "',3005),0.0001) "; return(PointsTypes.findPoint(distanceQuery + placeQuery + intersectionQuery)); }
public Image changeDistance(int _distance) { distance = ((float)_distance) / 5000; distanceQuery = PointsTypes.formDistanceQuery(searchName, distance); PointsTypes.init(_sharpMap, intersectionQuery + distanceQuery); listDispley = PointsTypes.queryPoints(intersectionQuery + distanceQuery); return(getMap()); }
private void Tourist_CheckedChanged(object sender, EventArgs e) { PointsTypes.toggleTouristLayer(Tourist.Checked); Map.Image = Layers.layers.getMap(); Layers.layers.queryPoints(); listBox1.DataSource = Layers.layers.listDispley; initSearch(); SearchByName.Clear(); }
public Image SearchPointsByName(string name, float _distance) { _sharpMap.Layers.Remove(PointsTypes.searchLayer); _sharpMap.Layers.Add(PointsTypes.search(name)); searchName = name; distance = ((float)_distance) / 5000; distanceQuery = PointsTypes.formDistanceQuery(name, distance); PointsTypes.init(_sharpMap, intersectionQuery + distanceQuery); listDispley = PointsTypes.queryPoints(intersectionQuery + distanceQuery); return(getMap()); }
public Image getIntersection() { if (intersectionPoints.Count > 2) { int i = 0; string polygon = "POLYGON(("; for (i = 0; i < intersectionPoints.Count; i++) { polygon += intersectionPoints[i].X + " " + intersectionPoints[i].Y + ","; } polygon += intersectionPoints[0].X + " " + intersectionPoints[0].Y + "))"; intersectionQuery = " AND ST_Intersects(geom, ST_GeomFromText('" + polygon + "',3005))"; PointsTypes.init(_sharpMap, intersectionQuery + distanceQuery); listDispley = PointsTypes.queryPoints(intersectionQuery + distanceQuery); intersectionPoints.RemoveRange(0, intersectionPoints.Count); } return(getMap()); }
private Layers() { _sharpMap = new SharpMap.Map(new Size(802, 362)); _sharpMap.BackColor = Color.FromArgb(232, 232, 232); SharpMap.Layers.VectorLayer landuseLayer = new SharpMap.Layers.VectorLayer("Landuse"); landuseLayer.DataSource = new SharpMap.Data.Providers.PostGIS(connString, "landuse", geomname, idname); landuseLayer.Style.Fill = new SolidBrush(Color.FromArgb(192, 236, 174)); landuseLayer.Style.Outline = Pens.Green; landuseLayer.Style.EnableOutline = true; _sharpMap.Layers.Add(landuseLayer); SharpMap.Layers.VectorLayer roadsLayer = new SharpMap.Layers.VectorLayer("Roads"); roadsLayer.DataSource = new SharpMap.Data.Providers.PostGIS(connString, "nis_routing", "geom_way", "id"); roadsLayer.Style.Line.Width = 1; roadsLayer.Style.Line.Color = Color.WhiteSmoke; _sharpMap.Layers.Add(roadsLayer); setPlacesLayer(); SharpMap.Layers.VectorLayer buildingsLayer = new SharpMap.Layers.VectorLayer("Buildings"); buildingsLayer.DataSource = new SharpMap.Data.Providers.PostGIS(connString, "buildings", geomname, idname); buildingsLayer.Style.Fill = new SolidBrush(Color.FromArgb(192, 236, 174)); buildingsLayer.Style.Outline = Pens.Green; buildingsLayer.Enabled = false; _sharpMap.Layers.Add(buildingsLayer); SharpMap.Layers.VectorLayer railwaysLayer = new SharpMap.Layers.VectorLayer("Railways"); railwaysLayer.DataSource = new SharpMap.Data.Providers.PostGIS(connString, "railways", geomname, idname); railwaysLayer.Style.Line.Width = 1; railwaysLayer.Style.Line.Color = Color.DarkGray; railwaysLayer.Enabled = false; _sharpMap.Layers.Add(railwaysLayer); PointsTypes.init(_sharpMap, ""); _sharpMap.ZoomToExtents(); }
public string getDisplayDistance(string gid) { return(PointsTypes.getLabelInfo(searchName, gid, _sharpMap)); }
public void queryPoints() { listDispley = PointsTypes.queryPoints(intersectionQuery + distanceQuery); }