|
POST
|
You'll want to use SpatialReference.create instead of new SpatialReference. Also, the spatial reference won't be set for the map until you set the extent of the map. Below is the logic I used on my end. public MainWindow()
{
InitializeComponent();
MyMapView.LayerLoaded += (sender, args) =>
{
Debug.WriteLine(args.Layer);
Debug.WriteLine(args.LoadError);
};
MyMapView.ExtentChanged += (sender, args) => Debug.WriteLine(MyMapView.Extent);
MyMapView.Loaded += async (sender, args) =>
{
string srcPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string mpkPath = Path.Combine(srcPath, @"data\MapPackage3857.mpk");
LocalMapService lms = new LocalMapService(mpkPath);
await lms.StartAsync();
ArcGISDynamicMapServiceLayer dmsLayer = new ArcGISDynamicMapServiceLayer(new Uri(lms.UrlMapService));
//ArcGISDynamicMapServiceLayer dmxLayer = new ArcGISDynamicMapServiceLayer(new Uri("http://services.arcgisonline.com/arcgis/rest/services/World_Topo_Map/MapServer"));
BackgroundGroupLayer grpLayer = new BackgroundGroupLayer();
//GroupLayer grpLayer = new GroupLayer();
grpLayer.ChildLayers.Add(dmsLayer);
Map map = new Map
{
SpatialReference = SpatialReference.Create(3857),
InitialViewpoint =
new Viewpoint(new Envelope(-20037508, -12242956, 20037508, 12242956,
SpatialReference.Create(3857)))
};
//map.Layers.Add(dmxLayer);
map.Layers.Add(grpLayer);
MyMapView.Map = map;
};
}
public class BackgroundGroupLayer : GroupLayer
{
}
... View more
10-14-2015
04:13 PM
|
1
|
2
|
2380
|
|
POST
|
I can replicate the same. The problem appears to be related to the Spatial Reference (sref) not being set for the view when adding the extended basemap layer. Have you noticed that when loading a GroupLayer that the sublayer is added first to set the sref, whereas adding an extended GroupLayer adds the GroupLayer first, which causes the sublayers to throw System.InavlidOperationException : The View did not obtain a spatial reference from the base layer when adding its sublayers. If I set the spatial reference on the map directly or add a layer prior to adding the groupLayer that sets the sref of the view everything works just fine.
... View more
10-14-2015
10:13 AM
|
1
|
4
|
2380
|
|
POST
|
Have you tried logic similar to the following? This appears to work for me.
... View more
10-14-2015
09:18 AM
|
0
|
8
|
2380
|
|
POST
|
There is a function in arcpy to allow you to test for schema locks. TestSchemaLock http://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-functions/testschemalock.htm You will want to implement If-then-Logic in your model if you want it to continue working if it is unable to get an exclusive lock. An example of this is shown on the following page: Using If-Then-Else logic for branching http://desktop.arcgis.com/en/desktop/latest/analyze/modelbuilder/using-if-then-else-logic-for-branching.htm You would need to essentially modify the code uses within the examples to leverage the TestSchemaLock method. This would allow you to skip portions of your model if they aren't ready to run. As a more advanced idea, you may be able to implement logic in the script that could check for the locks over a period of time prior to updating the model if it can continue. Python time.sleep method http://www.tutorialspoint.com/python/time_sleep.htm
... View more
10-12-2015
03:07 PM
|
1
|
0
|
2260
|
|
POST
|
Are you having a problem instantiating the GeoDataServer? If you don't want to use this approach you could leverage the gp tool. Create Replica http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/create-replica.htm
... View more
10-12-2015
09:15 AM
|
0
|
1
|
1257
|
|
POST
|
Hi Dan, Thanks for the update, but I somewhat disagree with not mixing spreadsheets with database tables. Even outside of the ArcGIS platform there are tons of valid workflows where users store data in a spreadsheet and later need to migrate that information into a database. Similar to this case, I could replicate the same behavior within most relational databases (i.e. SQL Server, Oracle, PostGreSQL, etc.). Although it may be cumbersome, certain practices must be followed in the creation of the spreadsheet to ensure that the data can easily be migrated. This is the reason why pages were created to assist users with this workflow. Formatting a table in Microsoft Excel for use in ArcGIS http://desktop.arcgis.com/en/desktop/latest/manage-data/tables/formatting-a-table-in-microsoft-excel-for-use-in-arcgis.htm Understanding how to use Microsoft Excel files in ArcGIS http://desktop.arcgis.com/en/desktop/latest/manage-data/tables/understanding-how-to-use-microsoft-excel-files-in-arcgis.htm If you want to see an extreme, but valid, use of spreadsheets in ArcGIS you should check out plugin datasources. Simple point plug-in data source http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#/d/0001000001t4000000.htm In a plug-in data source you can go so far as writing code that will get a text file to behave in the same manner of a feature class within ArcGIS. I'm still amazed by how many people would rather implement this instead of simply using data in a geodatabase.
... View more
10-12-2015
09:10 AM
|
0
|
2
|
3620
|
|
POST
|
Hi Timothy, You may want someone in support to take a look at this. Spreadsheets and flat-files, such as Excel, csv, etc., do not enforce field types. As such, ArcGIS should scan the first eight rows to determine the type of the field. In the case of your issue the values are showing as NULL because the system determined that the field type is numeric. From what I'm guessing this may be related to the names of the fields used in your spreadsheet not being optimized for use in ArcGIS. I properly formatted the field names and the data came across as you stated it did in 10.3.0.
... View more
10-10-2015
11:57 PM
|
0
|
4
|
3620
|
|
POST
|
Have you tried extending the Editor class? I'm able to accomplish this with the logic shown below: public class MyEditor : Editor
{
private VertexPosition _vertexPosition ;
public VertexPosition MyPosition { get { return this._vertexPosition; } set { this._vertexPosition = value; } }
public MyEditor()
{
_vertexPosition = null;
}
protected override Symbol OnGenerateSymbol(GenerateSymbolInfo generateSymbolInfo)
{
if (generateSymbolInfo.GenerateSymbolType == GenerateSymbolType.SelectedVertex)
_vertexPosition = generateSymbolInfo.VertexPosition;
return base.OnGenerateSymbol(generateSymbolInfo);
}
} As a result of geometries being immutable I don't believe you would be able to modify an existing geometry's vertices. Instead, you should be able to use the builder to create a new line or polygon with your needed change. For example, I use this approach to move the vertices for polygons to the current gps location. I use the following line to get an array of the vertices for my selected polygon. var points = ((Polygon) EditGeometry).Parts[0].GetPoints().ToArray(); Once I have the array of points I then use the index of the selected vertex to manipulate this array prior to calling the PolygonBuilder and creating a new polygon with my needed geometry.
... View more
10-09-2015
02:44 PM
|
0
|
2
|
1963
|
|
POST
|
Have you tried the steps mentioned on the following page? Joining Data http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#//0001000002zw000000
... View more
10-08-2015
03:04 PM
|
0
|
0
|
1029
|
|
POST
|
Range wise is available via the exportToPDF function of the datadrivenpages class. DataDrivenPages http://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-mapping/datadrivenpages-class.htm For the attributes could you explain what types of attributes you're needing to search for?
... View more
10-07-2015
09:11 AM
|
1
|
0
|
698
|
|
POST
|
The ArcObjects SDK has not been deprecated and is a seperate product to the newer ArcGIS for Runtime APIs. You should be able to find the installs for the ArcObjects (.NET/Java/C++) SDK within your MyEsri account under your available downloads. I have added a screenshot of what this would look like below. I believe what you're going to be concerned about is the deprecation of DCOM at 10.1, which is going to greatly impact how you're communicating with the server. I would suggest reading over the following blog: Considerations for arcgis server developers a look toward 10.1 http://blogs.esri.com/esri/arcgis/2011/04/27/considerations-for-arcgis-server-developers-a-look-toward-10-1/
... View more
10-07-2015
09:07 AM
|
1
|
0
|
1209
|
|
POST
|
I think this may help point you in the right direction if you want to obfuscate your code. How do I protect python code http://stackoverflow.com/questions/261638/how-do-i-protect-python-code I would agree with most of the people on the above discussion that python is just a language that wasn't truly designed to be obfuscated. Typically if I need to hide some logic from a user I write my code in .NET/Java ArcObjects, but I've never needed to truly lock anything down.
... View more
10-05-2015
05:08 PM
|
1
|
0
|
3160
|
|
POST
|
Could you upload some of your code so I can get a better picture of what you're doing? For the most part whether you're working in an enterprise geodatabase or a local geodatabase (i.e. file or person) the workflow shouldn't differ. In order to use the describe object you'd need to have a reference to the dataset, whether it be the direct path to it or a layer that points to the data. That's why I'm a little confused on getting the path if you're able to get to this point. Hopefully by looking at your logic will help me fill in some of the blanks so that we can give you a solid answer for this.
... View more
10-03-2015
10:58 AM
|
2
|
2
|
3962
|
|
POST
|
Within your script tool do you have the result layer object from the Make Feature Layer tool assigned to one of your output parameters?
... View more
10-03-2015
10:44 AM
|
1
|
1
|
3069
|
|
POST
|
Could you provide a little more detail on how you're using the describe object against the feature classes? I would assume if you're to the point where you can describe the feature class you could also grab the path to the feature class on disk and check against it.
... View more
10-01-2015
05:01 PM
|
3
|
4
|
3962
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 01-19-2016 04:45 AM | |
| 1 | 09-24-2015 06:45 AM | |
| 1 | 09-15-2015 10:49 AM | |
| 1 | 10-12-2015 03:07 PM | |
| 1 | 11-25-2015 09:10 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|