Using gvNIX to create a map-based application

I am interested in creating the gvNIX / Roo application, which shows the location of medical facilities in Tanzania on a map. I am trying to use the tutorial here . However, my data is in the format shown below, where my location data is in two columns ( southings and eastings ). The tutorial shows how to create three types of data:

 field geo --fieldName location --type POINT --class ~.domain.Owner field geo --fieldName distance --type LINESTRING --class ~.domain.Owner field geo --fieldName area --type POLYGON --class ~.domain.Owner 

I suppose I need a POINT data type to store data in the location of a medical facility, but I'm not sure how to get below 2 columns (south and east) into a single POINT variable. I am very new to GIS. The data is shown below (csv format):

 outlet_name,Status ,southings,eastings,streetward,name_of_outlet REHEMA MEDICS,02,2.49993,32.89512,K/POLISI,REVINA KIRUMBA MEDICS,02,2.50023,32.89503,K/POLISI,GEDION KIRUMBA PHARMACY,02,2.50152,32.89742,K/POLISI,MAURETH TULI MEDICS,02,2.48737,32.89686,KITANGIRI,TULI JULLY MEDICS,02,2.53275,32.93855,BUZURUGA,JULLY MAGOMA MEDICS,02,2.53181,32.94211,BUZURUGA,MAGOMA MECO PHARMACY,02,2.52923,32.94730,MECCO,DORCAS UPENDO MEDICS,02,2.52923,32.94786,MECCO,UPENDO DORIS MEDICS,02,2.49961,32.89191,KABUHORO,DORIS SOPHIA MEDICS,02,2.49975,32.89120,KABUHORO,ESTER MWALONI PHAMCY,02,2.56351,32.89416,MWALONI,ESTER SILVER PHAMACY,02,2.51728,32.90614,K/KILOMERO,WANDWATA KIBO PHARMACY,02,2.51688,32.90710,MISSION,MARIAM 

thanks

0
source share
1 answer

You need to convert your coordinates to WKT (well-known text) to insert them into a column in your database (a postgresql database with postgis support). To do this, you need to follow these steps:

  • Find the SRID of your coordinate system (CRS). That is the identifier that defines your coordinate system. Otherwise, your points will not correspond to the actual coordinates. At the last stage, you will need an SRID.
  • Convert your data to WKT. The data needed to insert the points is in the southings and eastings columns (I assume that they are equal to the latitude and longitude that are most commonly used), so you will need to convert these columns to a single column with the WKT format. for example, for your first data row: Point(32.89512 2.49993) . Pay attention to the space between them and the switch between the numbers.
  • Continue to work with SQL syntax inserts, but use postgis functions. An example for your first line: INSERT into health_facilities (outlet_name, Status, streetward, location) VALUES ('REHEMA MEDICS', 02, 'K/POLISI', ST_GeomFromText('Point(32.89512 2.49993)', 4326)); . Where “4326” are the SRID numbers you should find (preemption is the most common → EPSG: 4326).

Here you can find more information here . There are also several pages where you can check the coordinates and convert them between different CRS, for example this and this .

+2
source

Source: https://habr.com/ru/post/1240525/


All Articles