POST
|
Hello Zahid, Here is the code and it works. I am not sure which programming language you are using but you could convert it. Thanks, James
... View more
12-12-2014
02:26 PM
|
2
|
0
|
627
|
POST
|
XAML
<UserControl x:Class="AddPointTest.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:esri="http://schemas.esri.com/arcgis/client/2009"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<Grid x:Name="LayoutRoot" Background="White">
<Grid.Resources>
<esri:SimpleMarkerSymbol x:Key="RedMarkerSymbol" Color="Red" Size="12" Style="Circle" />
<esri:SimpleMarkerSymbol x:Key="BlackMarkerSymbol" Color="Black" Size="14" Style="Diamond" />
</Grid.Resources>
<esri:Map x:Name="MyMap" WrapAround="True" Background="White">
<esri:ArcGISTiledMapServiceLayer ID="PhysicalTiledLayer"
Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"/>
<esri:GraphicsLayer ID="MyGraphicsLayer" />
</esri:Map>
</Grid>
</UserControl>
... View more
12-12-2014
02:13 PM
|
2
|
0
|
627
|
POST
|
C#
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.ServiceModel.Web;
using System.Runtime.Serialization.Json;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using ESRI.ArcGIS.Client;
using ESRI.ArcGIS.Client.Geometry;
using ESRI.ArcGIS.Client.Symbols;
namespace AddPointTest
{
public partial class MainPage : UserControl
{
private static ESRI.ArcGIS.Client.Projection.WebMercator mercator =
new ESRI.ArcGIS.Client.Projection.WebMercator();
public MainPage()
{
InitializeComponent();
AddMarkerGraphics();
}
void AddMarkerGraphics()
{
string jsonCoordinateString = "{'Coordinates':[{'X':13,'Y':55.59},{'X':72.83,'Y':18.97}]}";
CustomCoordinateList coordinateList = DeserializeJson<CustomCoordinateList>(jsonCoordinateString);
GraphicsLayer graphicsLayer = MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer;
for (int i = 0; i < coordinateList.Coordinates.Count; i++)
{
Graphic graphic = new Graphic()
{
Geometry = mercator.FromGeographic(new MapPoint(coordinateList.Coordinates.X, coordinateList.Coordinates.Y)),
Symbol = i > 0 ? LayoutRoot.Resources["RedMarkerSymbol"] as Symbol : LayoutRoot.Resources["BlackMarkerSymbol"] as Symbol
};
graphicsLayer.Graphics.Add(graphic);
}
}
internal static T DeserializeJson<T>(string json)
{
T objectInstance = Activator.CreateInstance<T>();
System.IO.MemoryStream memoryStream = new System.IO.MemoryStream(System.Text.Encoding.Unicode.GetBytes(json));
System.Runtime.Serialization.Json.DataContractJsonSerializer jsonSerializer =
new System.Runtime.Serialization.Json.DataContractJsonSerializer(objectInstance.GetType());
objectInstance = (T)jsonSerializer.ReadObject(memoryStream);
memoryStream.Close();
return objectInstance;
}
}
[DataContract]
public class CustomCoordinateList
{
[DataMember]
public List<CustomCoordinate> Coordinates = new List<CustomCoordinate>();
}
[DataContract]
public class CustomCoordinate
{
public CustomCoordinate() { }
public CustomCoordinate(double x, double y)
{
this.X = x;
this.Y = y;
}
[DataMember]
public double X { get; set; }
[DataMember]
public double Y { get; set; }
}
}
... View more
12-12-2014
02:12 PM
|
2
|
2
|
627
|
POST
|
Hello Keith, Maybe you could use arcGIS to classify an image for a landcover analysis. Once the landcover analysis is complete, then use the ipad to ground truth your landcover analysis. By using the ipad, it could be either point, line, and/or polygon. You may be able to download a GPS application to use and export the files. Hope this helps! James
... View more
12-12-2014
01:46 PM
|
0
|
0
|
269
|
POST
|
Hello Stacy, Click on the 'Set Up Data Driven Pages' icon and click on the second tab called Extent. Click the Data Driven Scale radio button. From the drop down menu, select the attribute field with the scale. This work for me using my data. Thanks, James
... View more
12-12-2014
01:36 PM
|
0
|
4
|
1280
|
POST
|
Hello, With this code you have to create your shapefiles. I am new to Python Scripting so there may be excess to delete. Thanks, James
... View more
12-12-2014
12:40 PM
|
0
|
0
|
1207
|
POST
|
import arcpy, os
arcpy.env.workspace = "U:\Tax\Special Projects\JEFitzgerald\CUVA\2014\CUVA_PYTHON_06252014_Final\CUVA.mdb"
pointList=[]
#Finds the field named File and deletes it
try:
with arcpy.da.UpdateCursor("GC_R20_Polygon",("File"),'[File] =\'Done\'') as cursor:
cntr = 1
for row in cursor:
cursor.deleteRow()
print "Record number "+ str(cntr) + " deleted"
cntr = cntr + 1
except Exception as e:
print e.message
#**** CODE for R20 ****#
try:
with arcpy.da.SearchCursor ("GC_R20", ["SHAPE@XY"]) as cursor:
for row in cursor:
xy = row[0]
pointList.append(xy)
with arcpy.da.InsertCursor ("GC_R20_Polygon", ["SHAPE@"]) as U:
for pnt in pointList:
lowX = pnt[0]
lowY = pnt[1]
# find the upper right
highX = lowX + 162.2539
highY = lowY + 123.2639
array = arcpy.Array([arcpy.Point(lowX, lowY),
arcpy.Point(lowX, highY),
arcpy.Point(highX, highY),
arcpy.Point(highX, lowY),
arcpy.Point(lowX, lowY)])
polygon = arcpy.Polygon(array)
U.insertRow([polygon])
#Populates a field with DONE so the delete cursor will find and delete.
#This will enable a clean attribute table so dublicates will be eliminated.
arcpy.CalculateField_management("GC_R20_Polygon","File", "\"Done\"", "PYTHON", "")
print "Process for new polygons is complete"
print "James E. Fitzgerald, GISP, GIS Specialist"
except:
print
... View more
12-12-2014
12:37 PM
|
0
|
2
|
1207
|
POST
|
Hello Torika, Dan is correct. You can calculate it by using a Digital Elevation Model (DEM) or a National Elevation Dataset (NED). Simply extract values using a point shapefile and the elevation model raster. This will give you the Z values. Thanks James
... View more
12-12-2014
07:37 AM
|
2
|
2
|
637
|
POST
|
Hello Kira, It is possible to create custom shapes. It does, however, require python code to perform it. I can pass some code along to you. It basically works, in a manner, where the user drops a point and then draws a polygon. I used it to create many polygons based on zoning. The polygons were basic shapes based on length and height. If you had several custom shapes, then code would have to account for the dimensions.Also, you would have to start an edit session to orient the shapefiles. Let me know if you want the code James
... View more
12-12-2014
07:32 AM
|
3
|
2
|
1207
|
DOC
|
Hello Adam, Not sure if you can export shapefiles.shp from Business Analyst Online. It may depend on product's package subscription. If there are not many attributes to tag, then you may be able to georeference a screen shot and create shapefiles. Time consuming yes but affordable too. James
... View more
12-12-2014
07:11 AM
|
0
|
0
|
2851
|
POST
|
Hello Andreas Your problem can be frustrating! The solution is an easy fix. The proble is projection. You layer is in a projection called Germany Zone 3. This is fine. The solution is to reproject your shapefile to Germany Zone 3. Simply, go to export datat and export Qtypen_EF but CLICK THE RADIO BUTTION to THE DATA FRAME as the coordinate system. Click OK. This should fix it. Let me know if I can further assist. Also, give me credit for helping you with your problem. You can mark it as helpful, etc. BTW, your english writing is fine. James
... View more
12-12-2014
06:44 AM
|
1
|
1
|
699
|
POST
|
Code corrected. Thanks for the help! import arcpy
fc= r"U:\\Tax\\Special Projects\\JEFitzgerald\\CUVA\\Test\\Points.shp"
polygonFC= r"U:\\Tax\\Special Projects\\JEFitzgerald\\CUVA\Test\\Polygon.shp"
pointList=[]
####CODE VERSION####
# Source: "http://resources.arcgis.com/en/help/main/10.1/index.html#/
# Reading_geometries/002z0000001t000000/"
#for row in arcpy.da.SearchCursor (fc, [ "OID@", "SHAPE@XY"]):
#print ("feature {0}:".format(row[0]))
#print row[1]
#**** CODE ****#
#Sourc: "http://forums.arcgis.com/threads/96860-Create-multiple-polygons-in-ArcGIS-using-Python-
#and-an-XY-table?highlight=create+multiple+polygons"
with arcpy.da.SearchCursor (fc, ["SHAPE@XY"]) as cursor:
for row in cursor:
xy = row[0]
pointList.append(xy)
#print ("{0}, {1}".format(x,y))
with arcpy.da.InsertCursor (polygonFC, ["SHAPE@"]) as U:
for pnt in pointList:
lowX = pnt[0]
lowY = pnt[1]
# find the upper right
highX = lowX + 163.1935
highY = lowY + 183.831
array = arcpy.Array([arcpy.Point(lowX, lowY),
arcpy.Point(lowX, highY),
arcpy.Point(highX, highY),
arcpy.Point(highX, lowY),
arcpy.Point(lowX, lowY)])
polygon = arcpy.Polygon(array)
U.insertRow([polygon])
... View more
04-11-2014
04:19 AM
|
0
|
4
|
1518
|
POST
|
Here is the correct way...http://resources.arcgis.com/en/help/main/10.1/index.html#/Reading_geometries/002z0000001t000000/ import arcpy fc= r"U:\\Tax\\Special Projects\\JEFitzgerald\\CUVA\\Test\\Points.shp" polygonFC= r"U:\\Tax\\Special Projects\\JEFitzgerald\\CUVA\Test\\Polygon.shp" pointList=[] ####CODE VERSION#### #for row in arcpy.da.SearchCursor (fc, [ "OID@", "SHAPE@XY"]): #print ("feature {0}:".format(row[0])) #print row[1] #**** CODE ****# with arcpy.da.SearchCursor (fc, ["SHAPE@XY"]) as cursor: for row in cursor: xy = row[0] pointList.append(xy) #print ("{0}, {1}".format(x,y)) with arcpy.da.InsertCursor (polygonFC, ["SHAPE@"]) as U: for pnt in pointList: lowX = pnt[0] lowY = pnt[1] # find the upper right highX = lowX + 163.1935 highY = lowY + 183.831 array = arcpy.Array([arcpy.Point(lowX, lowY), arcpy.Point(lowX, highY), arcpy.Point(highX, highY), arcpy.Point(highX, lowY), arcpy.Point(lowX, lowY)]) polygon = arcpy.Polygon(array) U.insertRow([polygon])
... View more
04-10-2014
01:52 PM
|
0
|
0
|
424
|
POST
|
Hello, I have a question about the code below. Do I create default point and polygon shapefiles or do I neet to add attributes to the point and polygon shapefiles. I have been trying to work on this code and have not been able to get it to work. Not sure about shortList and pointList. This code has been copied from another post. import arcpy pointFC = r"C:\Users\whitley-wayne\Desktop\summary\data.gdb\funds" polygonFC = r"C:\Users\whitley-wayne\Desktop\summary\data.gdb\hab60" pointList = [] with arcpy.da.SearchCursor(pointFC, "SHAPE@XY") as cursor: for row in cursor: shortList = list(row[0]) pointList.append(shortList) with arcpy.da.InsertCursor(polygonFC, ["SHAPE@"]) as c: for pnt in pointList: # start with the lower left lowX = pnt[0] lowY = pnt[1] # find the upper right highX = lowX + 20 highY = lowY + 20 array = arcpy.Array([arcpy.Point(lowX, lowY), arcpy.Point(lowX, highY), arcpy.Point(highX, highY), arcpy.Point(highX, lowY), arcpy.Point(lowX, lowY)]) polygon = arcpy.Polygon(array) c.insertRow([polygon])
... View more
04-10-2014
03:48 AM
|
0
|
2
|
704
|
Title | Kudos | Posted |
---|---|---|
1 | 01-29-2015 07:27 AM | |
1 | 12-12-2014 06:44 AM | |
1 | 12-16-2014 10:39 AM | |
1 | 07-22-2015 12:25 PM | |
2 | 12-12-2014 02:12 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|