Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Hot answers tagged

58

UPDATE 13.10.2016: Right click on the layer in the Table of Contents (aka. legend or layer tree) and open the Save As... dialog. Once there, click on the Format option list and choose MS Office Open XML spreadsheet [XLSX]. Note that you also have an option for Libre Office files: Open Document spreadsheet [ODS]. I'm using QGIS v.2.14.4 PREVIOUS ...


37

GPS Visualizer will take a Google Map route (url) and convert to .gpx "You can ignore most the options, just select Gpx and paste the Google Maps URL into the box labelled “provide the URL of a file on the Web” and then press the Convert button" http://www.gpsvisualizer.com/convert_input Guide http://bedsforcyclists.co.uk/articles/2014/04/13/how-...


31

You can do this using a cursor to grab the data from your table and write to a comma-delimited text file. EDIT: I'm adding a more concise block of code to accomplish the task using the csv module of Python New Answer using arcpy.da cursor: import arcpy,csv table =r'c:\path\to\table' outfile = r'c:\path\to\output\ascii\text\file' #--first lets make a ...


26

To get a csv file of the attribute table, rightclick on the layer in the legend, select Save As ..., and change the file format from shapefile to CSV. You might need to change the separator from comma to semicolon in a text editor if Excel does not like the default separator.


21

Try this Frida: Create a folder to store your Shapefiles there (e.g., I've created the folder /tmp/data/, I use GNU/Linux). In QGIS, open the QGIS Python console. Write the following line, editing the right hand side to match the full path to your folder (make sure you include the trailing slash/backslash): myDir = '/tmp/data/' Press Enter. Copy the ...


20

You can use the DBManager core plugin


19

You mention that you computed a list of values in a Python script, so the easiest way to dump that to a csv would be to use the csv module! import csv res = [x, y, z, ....] csvfile = "<path to output csv or txt>" #Assuming res is a flat list with open(csvfile, "w") as output: writer = csv.writer(output, lineterminator='\n') for val in res: ...


17

You can do this using the Calculate Value (Data Management) tool and some Python magic. See also this related question: Add arbitrary code to Arcgis model builder? A multivalue variable is just a semicolon-delimited string of values, so what the multivaluesToCsv function below does is split the multivalue variables into lists and transpose them into rows ...


17

You may use the Feature Class To Feature Class python snippet. Here is the general syntax. FeatureClassToFeatureClass_conversion (in_features, out_path, out_name, {where_clause}, {field_mapping}, {config_keyword}) To output to a shapefile, make sure that your out_path is a folder (and not pointing within a file geodatabase), and that out_name has a *....


16

I was able to export to CSV, using other than a comma, by separating the layer creation options in the Save As.. dialog with linebreaks. Neither comma, nor space-separating them (even when they were in quotes) worked, but the linebreaks did the trick. To emphasize.. THIS APPROACH WORKED (linebreak-separated): GEOMETRY=AS_WKT SEPARATOR=SEMICOLON ...


15

you can use the export (multiple). In ArcCatalog... Just right click on the database and choose "export to shapefile (multiple)" If you do it at the database level you will see everything in the database in the tool listed (there is a remove button if there are a few you don't want). If you do it at the feature dataset level you see everything in ...


15

As @oyvind suggested, shp2pgsql is the best method for just getting the data into a PostGIS database. OpenGEO has a good startup guide for loading data into PostGIS that should get you up and running if you're having issues. As @nathanw pointed out, DB Manager is a good option for importing a shapefile into a database. Also available is PostGIS Manager, ...


15

If you're looking to reproject csv files from the Python Console in QGIS then you could use the following script. All you would need to change are the three paths which are mentioned in the comments. Essentially, the script imports your csv files into QGIS as shapefiles (assuming your geometric fields are named X and Y). It then uses the qgis:reprojectlayer ...


14

This is possible in QGIS using the print composer. You'll need to both: Remove the background color from the map item. This is done by unchecking the "background" option in the map item's properties. (The default is a white background) Set the page itself to a transparent style. This is done through the composition properties tab.


13

In order to solve this question, we need to use timers or something that delays the execution of the script, so the canvas can reflect the layer arrangement at the time the map is exported. In other words, if you don't use timers you'll end up with 3 PNG images with the same content because everything will happen too fast. In the QGIS map, set the map ...


13

I added aerial imagery from GIS server and created fishnet over the area of interest: I use fishnet as index layer for my data driven pages, making sure the sorting order coincides with record order in fishnet table. I applied script (see below) to travel through pages, export them to temp raster, clip it to PNG raster named after page name. Result shows ...


12

Yet another option, this is more of a theory and programmatic one, using arcpy. A polygon can consist not only of a single outer ring with a single inner donut hole -- they can be nested to an arbitrary number of levels. Consider the following: Difference between outer and inner rings http://edndoc.esri.com/arcobjects/8.3/componenthelp/esricore/.%...


12

Have a look at ?writeRaster from the raster package. Depending on the desired output format, just edit the format argument ("GTiff" for .tif, "HFA" for .img, and "ascii" for ESRI .asc). Here's some sample code, writeRaster(yourRasterObject, "outputFilename", format = "GTiff")


12

To export a route to KML you'll have to use Google MyMaps. add a route to new or existing layer drag and drop the route to suit your needs Open the maps options menue (3 dots above the layers) Export to KML You can then use any service to convert the KML to GPX. I prefer GPSies.


12

For clarity (Windows 10) Download the OSGeo4W (64 bit) https://qgis.org/en/site/forusers/download.html Install as Advanced Install Change the default GDAL to 3.1.0.137 Then in QGIS you should get the option for Exporting to Geo-PDF Hopefully soon (when GDAL/GRASS is updated) this becomes the default in the QGIS install.


11

Use the plugin MMQGIS to export geometry to csv. I just try with your file, it works perfectly.


11

In QGIS you can use R-Click and Save As... to save the WMS, and any other service, as a raster image. It saves is at a tiff, and the resolution needs to be set by you. There are other expression and creation options as well.


11

You are exporting to Default.gdb. You need to change the location to a folder and the format menu will be activated to choose among the list of formats. [ [


10

Jakup: Here's a link to an ESRI page that has links to both the 9x sample and the 10x code: http://support.esri.com/en/knowledgebase/techarticles/detail/29935 9x had a Detect Complex Output sample that could alert one to the presence of a symbol, setting, etc. that was causing rasterization. I can't find a similar sample made for 10x and haven't tried ...


10

Quantum GIS now supports this feature, the resolution can be set and can include an optional world file containing georeferencing information. In the print composer check the "World file on" box under Export settings.


10

A very simple solution is as follows: Open the attribute table and enable editting (yellow pencil button at the bottom of the dialog box) Click the calculate fields button (calculator icon at the bottom) and create a new field for firstX (possibly changing the output field type to decimal and setting the width and precision) and select 'xat' from the ...


10

Looks like GeoJSON file, You can view it by copy pasting the feature in geojson.io. Save the file with the .JSON extension instead of the .txt and you should be able to use it.


9

You can select all records in the attribute table using the grab handle (left most column) and by holding the Shift key (then choose 'Copy Selected'). Then simply open Excel and paste the values. This is much quicker than exporting to .dbf (unless of course you need to edit the attribute table data, in which case, it's preferable to do this in ArcMap using ...


9

If you open the attribute table, open an empty excel spreadsheet, Select all or some of the records in the attribute table. to select all the button in upper left gives this pulldown to accomplish that. right click on the left edge (on a box). copy selected. Switch to the spreadsheet. right click in the upper left cell (just one cell) ctrl+V (paste)....


9

It's used to eliminate any whitespace you may have around your layout in the output file. For example, I have some MXDs set up to print on a specific paper size with specific margins, so that the maps I print can be 3-hole punched or bound without the holes affecting the map window. But sometimes I don't care about that and just want everything to fill the ...


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