Tag Info

New answers tagged

0

You have the path wrong for the line that reads: arcpy.mapping.MapDocument(r"C:\Project\\" + mxd) you have made the path a raw string, so the double backslash is wrong and making it fail, it should either be: arcpy.mapping.MapDocument(r"C:\Project\" + mxd) or: arcpy.mapping.MapDocument("C:\\Project\\" + mxd)


0

it doesn't work for me, I can validate the GeoJSON with the online tool. Here is the GeoJson I get: { "type": "FeatureCollection", "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, "features": [ { "type": "Feature", "properties": { "FID": 0.000000 }, "geometry": { "type": "MultiPoint", "coordinates": [ [ 8.9777585, ...


0

You have to keep an eye on the extent and CRS of your layers. You can look that up with rightclick on the legend entry -> Properties -> Metadata tab. Layers that have an extent of within +/-180/90 are in a geographic CRS (like WGS84) using degrees as units; while all others use projected CRS like UTM or State Plane in meters or feet or what is used in ...


0

You can have up to 6 layers in the Editor, depending on your CartoDB account. You can check the info in this link. Even so, if you use CartoDB.js you can have unlimited layers. You can check a course about it this link.


0

As in this answer - you can grab a list of your Vector layers directly, simply by stating your target class type: map.getLayersByClass("OpenLayers.Layer.Vector")


1

I think you just need to set the srs property of the layer layer.srs = "EPSG:4326" layer.native_crs = "EPSG:4326"


0

Try the Unique_values_saver plugin for QGIS. It allows you to save one vector layer for each unique value from a specific field. For instance, for a layer with world countries and regions, I've generated 10 vector layers, each one corresponding to a different region. If you really need the way to do it in Python, just have a look at the source code of ...


1

You forgot to upload 2 files <script src="nzoutline.geojson"></script> <script src="sectors.geojson"></script> They should be in the same directory as 167finalAD.html


2

It is not as easy as it used to be, but there are some helper methods for the collection. That should allow you to do similar things as ThomasG77 described above. Assuming you have a map named map, with 4 layers i.e. [base_layer, coastlines, heatmap, markers] Then you can get the collection via map.getLayers(), and the array of layers via ...


0

edit: i did a bit of fiddling and realized that my original answer is incorrect. you need to loop through individual graphics and add() them one at a time because the graphics property of GraphicsLayer is not 'settable'. that being said, its important to note that there would be no performance benefit of the API exposing a technique to loading graphics in ...


0

You don't mention what your client is... If you're using JavaScript, you can form a WMS request that includes multiple layers and the order in the request changes what order they are rendered in. This is getting into custom web-mapping though, and it will take a bit of coding to set up a UI that lets you turn on and off layers, and ensures that they are ...


0

You should really update QGIS to v.>=2.4. Martin Dobias refactored the QGIS layer list widget (aka legend or ToC), enabling developers to manipulate legend objects from the QGIS API. Martin has recently posted a couple of articles on how to use the new legend API from Python: http://www.lutraconsulting.co.uk/blog/2014/07/06/qgis-layer-tree-api-part-1/ ...


1

I suggest to use this program to rename your files http://www.bulkrenameutility.co.uk/Main_Intro.php. It's open and easy to use. After you have renamed your file, you must open, with a text editor, your qgis project file (try notepad++) and make the same find&replace.


1

If you have a consistent schema for renaming them, you could do this in a python script. One method in python is os.rename(src, dest). Specific details would depend on what the algorithm for renaming the files is. This is for renaming the actual files, not just the layer names in the TOC. Otherwise, I don't know of an alternative to renaming them manually, ...


0

I am having trouble using this solution, most likely due to my lack of understanding of such things. can you please post an example of the result, I believe it would really help me out?


1

Looks like there is geometry mismatch between POINT and MULTIPOINT. The type of GEOMETRY that the layer is storing can be seen in that layers Properties window on the Metadata tab. You can try converting either layer to a POINT or MULTIPOINT (depending on your requirements) using the Vector > Geometry Tools > Multipart to Singleparts... or ...


1

for QGIS 2.6 here is the code to identify each layer and group them #make the desired groups for layers root = QgsProject.instance().layerTreeRoot() group1 = root.insertGroup(0, "Group Point") group2 = root.insertGroup(1, "Group Line") group3 = root.insertGroup(2, "Group Polygon") #get the list of layers ...


3

First, when you bring your DWG into ArcMap, there is no need to convert it to another file type, unless you are trying to edit the linework. You can view the file and change the way it looks without doing any conversion. (If you do need to edit it, right-click on the Polyline layer in the DWG and choose "Data" and "Export Data." You can then export it ...


2

It looks like using the read() method was returning a string. json.load will return you a json object that you can then parse: import urllib2 import json url = "http://<myserver-name>/ArcGIS/rest/services/CU/MapServer?<layer-index>f=pjson" response = json.load(urllib2.urlopen(url)) min_scale = response["minScale"] max_scale = ...


2

I did not know that the FID was not preserved by this tool. Strange. As Chris recommended, calculate a unique ID for each point before you use the buffer tool. The unique ID I use for all my points is a concatenation of the X and Y coordinates in a text field I call XY_LINK. You should be able to create a join field without creating any new feature ...


0

I cannot imagine this being an out-of-box option within the application. In 10.2, you may assign shortcut to turn on/off all layers in the TOC, but not specific to certain layer names. Most likely you will have to develop either VBA or .net function using arcobjects that calls a command on keyboard shortcut (to turn x layer on or off). Assign Shortcut Key ...



Top 50 recent answers are included