New answers tagged

0

Ok thanks, it's working now but as I have lines features, the GEOMETRY=AS_XY doesn't work, of course. I need to set -lco GEOMETRY=AS_WKT to store the whole line : $ ogr2ogr -f "CSV" MyLayer.csv MyLayer.geojson -lco GEOMETRY=AS_WKT And if I set the -overwrite flag I still have some error if I run the same translation as before (but it's working if I make ...


2

For the coordinates, see Get list of coordinates for points in a layer? or Reproject CSV file to different projecton using ogr2ogr -lco GEOMETRY=AS_XY is what you need. For the error part, just do as you are told: ogr2ogr -f "CSV" -overwrite MyLayer2.csv MyLayer.shp This will destroy any previous content of the csv file, and add values from the ...


0

The first picture is from a KML that allows me to add the altitude column in the attributes list, and the second one is from a KML that just adds a column of zeros:


1

Thanks to user30184! You helped me solve it. The SrcLayer must specify the same name as the CSV file. Here is the correct, working VRT file. The change is on line 4: <OGRVRTDataSource> <OGRVRTLayer name="example"> <SrcDataSource>D:\Temp\example_short.csv</SrcDataSource> <SrcLayer>example_short</SrcLayer&...


0

Create a unique ID field in the first column of the CSV file and populate it with a sequence (1,2,3...). Then load the CSV and join it to the shapefile. I've had Qgis display null values in the attribute table until I included an ID column to the data.


2

From QGIS 2.14 and on: Create attribute and fill with field calculator with expression: z ($geometry) Screenshot from my data. Version QGIS: 2.16.0 EPSG:28992


0

Alternatively, in QGIS save as CSV dialog, under the Geometry heading there is a tick box 'Include z-dimension'. Tick this box and select point. From the layer options heading, select XYZ for the geometry. Tested using QGIS 2.14.3 Essen


1

How are the Z values measured? Depending on what the z values are referenced to, you may be able to use them without 'reprojecting'. If they are referenced to the ellipsoid, you'll need to recalculate them. Here is an online calculator for this purpose: http://apps.linz.govt.nz/coordinate-conversion/index.aspx?Advanced=1 Here is a table of examples of ...


0

Since I asked this question QGIS has developed the capacity to do this more simply and easily... (since 2.14 I think)... so I'm returning to answer my own question. Use a QGIS 'Virtual Layer'. Menu: Layer|Add Layer|Add Virtual Layer (or corresponding button) In the image is the add virtual layer dialogue window that appears - in this case I'm working ...


0

If you want to use a CSVT file, you must use Add Vector layer. Delimited text does a datatype guess on its own. See Why the table fields imported from a .csv file have a length of zero? and Why are some columns not recognized as numeric even though I have a CSVT? about that.


1

Open as a text file layer (comma button on the right side panel) Set X,Y axis as long, lat Right click on the layer save as Set coordinate system CRS to WGS84 Set format to ESRI Shape file


1

For what it's worth, I entered your data into Libreoffice like this: I don't think I've got the data right, but that doesn't matter; it's just to illustrate the method. From here in Libreoffice I selected the percentage data and converted to numeric: Excel has a similar option to change how the data is stored. Note the percentage symbols have been ...


2

Your numbers still contain the "%" symbol. If you want them to be recognized as numbers then loose the "%". i.e.: LGA_NAME;Non-Indigenous;Aboriginal;Torres Strait Islander Albury (C);0.93;0.02;0.0 Armidale Dumaresq (A);0.88;0.06;0.00 Also be sure you are choosing the semicolon ";" as the "Custom delimiter" when you do the import.


1

If you do not have qgis installed, still you can do it online. Point2Poly You need to browse your csv file and select the latitude and longitude fields, then generate the shapefile.


0

pasting from a comment I see the issue. The problem is that once you add a layer to a map, the relation is "persisted" so if you re-upload your dataset as a new table you can't remove the previous dataset without removing also the map because of this link. What I sometimes do is to add an empty dataset to my map and then update manually the SQL, so if my ...


0

It is because your field names are invalid as (at least) shapefile column names and QGis seems to expect shapefile conforming field names. These must start with a letter not a digit.


1

Within the same folder as your csv file, you can save a csvt file which will then provide the field type for each field within the CSV. To do this list the field types you want each field to adhere to in a string within a text editor (notepad works for this) with each field separated by a comma. Make sure the order within the text file is the same as the ...


1

Meanwhile I tested this with 2.8.7LTR, 2.8.9LTR, 2.14.3, 2.15.0 on Win7, Win10, Win2008 R2, installed via OSGeo4w Installer or standalone. In all of these cases I can only select Text, unbegrenzte Länge (text) (unlimited Text). I explicitly do NOT have the option Text (string) with the ability to set the output field length to some value. Examples: 2.8.7 ...


1

In the screenshot you posted, you have selected the option for Output field type of "Text, unbegrentze Länge (text)", which Google translates as "Text, unlimited length". Since it is unlimited, precision and field length are set to a dummy value of -1. I am also using QGIS 2.14.3 (on Linux Mint 17.2), but I do not have the option of this data type. I ...


1

You are missing the field length. I don't know why you have Text, unbegrenzte Länge (text), I only can choose Text (string) with the ability to set the output field length to 10 or 100 or else. With a given field length, it works for me. Same QGIS version, 64bit, Windows standalone and Linux Mint. UPDATE It seems to be a difference whether you add the ...



Top 50 recent answers are included