-2

I have some points without XY coordinates, and it is a global point dataset. This dataset is a 1*1 grid in a 400*800 dimension. It is quite obvious that each point has specific XY coordinates, but I don't know how can I assign a coordinate to each point? Is there any way to assign a coordinate to each single point? My file is a CSV format and when I import this file to Qgis, because it doesn't have a coordinate I have to import it as a table (no geometry - attribute only table). I cannot edit this table.

How can I edit it?

PolyGeo
  • 65,136
  • 29
  • 109
  • 338

1 Answers1

1

Open up the Attribute Table. Turn on editing for the layer.

Using the field calculator, calculate a new field with the following info:

Name: X

Type: Decimal Number (real)

Width: 12 Precision:2

For your expression you want:

$x

calucalte X

Repeat for Y.

HeikkiVesanto
  • 16,433
  • 2
  • 46
  • 68
  • Thank you for your response. but the problem is that it is a csv file and when I import this file to Qgis, the editing mode is off. I didn't explain that this is a CSV file. – Profesional Jul 30 '15 at 12:50
  • Right click your layer in the table of contents and export it to a shapefile (.shp) This will make a permanent layer of your points which you can then edit and add the X Y fields to – MAJ742 Jul 30 '15 at 12:55
  • It this is a csv file. How are you getting it to show on the map without x and y? – HeikkiVesanto Jul 30 '15 at 12:59
  • I tried to export it, but it shows me an error that is not valid or recognized datasource. I just import it to Qgis, but It doesn't show a map. It is just like a table file. – Profesional Jul 30 '15 at 13:00
  • Ah OK, try following these steps: http://www.qgistutorials.com/en/docs/importing_spreadsheets_csv.html then you'll be able to export and add fields – MAJ742 Jul 30 '15 at 13:09
  • Thanks for your reply, But my main problem is that I don't have a coordinate in my file. I mean there is no X and Y values including my file. Then how can I import a CSV file without long and lat? The only way come to my mind was to import this file as a table! – Profesional Jul 30 '15 at 13:20