Tag Info

Hot answers tagged

5

This is a great question, I had to do something similar recently but with a much smaller dataset, so I was able to use a simple intersection with some extra visual quality checking and it was fine. But here's an idea for this, though I don't have code, and it's kind of a hefty process. Definitely test with a sample from the full dataset first. You can ...


3

There is a standard already there called ArcInfo ungenerate(export). Using the ArcInfo generate(import) and ungenerate command. But there are many other technologies doing the same thing now such as json, landxml, esrixml workspace document and many others I can't even keep up with. ETGeowizards contains a tool to create the ungenerate file. go to ...


3

I've certainly created something like this; it's a great use for definition queries. Here's a copy/paste/modification from a tool I've written. You'll have to look up how to create a script tool in a toolbox. When you do, make two parameters, one to hold the input shapefile/feature class (type = Feature Class or Layer), and one to enter the "layer by" ...


3

In Field Calculator, you can try this Python code: ",".join({"1":"White","2":"Black","3":"Red"}[val.strip()] for val in !INPUT_FIELD_NAME!.split(",")) All you need to do is to pick your enumeration field for !INPUT_FIELD_NAME! and make sure you are using Python Parser! UPDATE OK, the below is another solution by creating a look-up table (dbf table in ...


2

You could try exporting the whole project with extent and pixel size=resolution set to match the input files: qgis --project myproject.qgs --snapshot image.png --width 1500 --height 1000 --extent xmin,ymin,xmax,ymax cf. http://anitagraser.com/2010/11/30/creating-high-resolution-images-using-qgis/ edit: that's comparable to Project->Save As Image ...


2

If you want to add some attributes from red layer to blue layer and one attribute is common in both layers, you have to use Add Vector Join. I've written about that here. Right click on your red shapefile layer on Layer Panel and choose Properties. Then go to Joins tab. Press the + button, it will create new join. Join layer is your red shapefile layer. ...


2

Try saving the mxd using the save() method or just refresthing the display/TOC. If scripting is used to modify the appearance of some map document elements while using the CURRENT map document (for example, change a layer name, the data frame extent, and so on), the map may not automatically update with each executed line of code. To refresh the ...


2

Here's a script that might do it for you. The native arcpy.Geometry class has a method called "cut" that will cut any feature using another polyline. Unfortunately, since you're using "points", we have to make "fake" lines out of these points. I essentially made a scratch polyline with the points [(Point.X+10, Point.Y+10), (Point.X-10, Point.Y-10)] - e.g. a ...


2

To find the name of the dataset as stored in the database use IDataset.BrowseName. IDataset.Name will give you the layer name as it is named in ArcMap. You should also test that the layer can be cast to IDataset: If TypeOf currentLayer Is IDataset Then... Things like group layers don't implement IDataset, and will cause an error.


1

All understandable! So for scenario 1 you created a layer file called red_sections.lyr then added that to MXD_2. In windows explorer if you look at the folder with the red_sections.lyr file it is only a few KB in size, so it cannot possibly be the data (all your polygons). A LayerFile which is what you created just holds symbology any definition queries plus ...


1

You are not telling us how you get the WMS in Leaflet: are you using the default object or a plugin? I have experiences the "cut" issues with labels too. I suspect that the problem might come from the fact that Leaflet WMS object is a extension of the Tile object and somehow in the request processing somehting ges wrong. The geometric object to which the ...


1

There are no problems with the coordinates included in your code. The problem is with, how you included them. The coordinate transformation goes smoothly as far as I can see, but I changed your iteration technique to my own, because for me, the one included in your Fiddle was a bit strange (I hope that won't lead to a confusion). The first problem was with ...


1

@comments If you cant set a Parameter 'slider: false' for the Basic layer group (you are using map.getLayerGroup()) then you should just set the slider for all layers true resp. false/undefinded for the ones who shouldn't have a slider. After that switch the If-statment. var slider = layer.get('slider'); var name = layer.get('name') ? ...


1

I much prefer the answer from @dmh126 as his method allows your red_line layer to be updated quite easily. Just to add an alternative, you can use the Join attributes table tool from the Processing Toolbox and select your layers with the common field. Note that this method creates a new shapefile instead of updating an existing one:


1

You can get the layers selected in the TOC with something like this selectedLayers = iface.legendInterface().selectedLayers() the selectedLayers method in QgsLegendInterface do the trick.



Only top voted, non community-wiki answers of a minimum length are eligible