Rāda ziņas ar etiķeti maps. Rādīt visas ziņas
Rāda ziņas ar etiķeti maps. Rādīt visas ziņas

2012-02-09

Lines to poly in QGIS

Video which shows how to convert bunch of lines to polygon using buffer and dissolve technique.

2011-08-31

google maps and proj4js. movable marker

Another script which combines proj4js and google maps together. This one gets coordinates from one system (EPSG:25884) which are generated in input boxes (and if there is none or wrong format, gives default values), converts to wgs84 lat/long and sets a movable marker on the google maps. As the user is moving marker, it defines the new center of the map after the user releases it and the new coordinates has been calculated back from lat/long to epsg:25884 and putted in the text box.

2011-01-30

Python scripting under GRASS GIS

It was few months ago when I using GRASS last time. Since then there was few things that came in my mind about scripting. I discovered, that it was very easy building and launching bash scripts under windows environment, but I never tried Python.
Today, just accidentally, I was starting to think about it again, and discover, that it is not as easy as bashing, but very close.
The first thing was - install Python. In my case I was using Python 2.7.
The second - to set neccessary environmental variables.
And here comes where attention is needed.
In GRASS GIS homepage there are some samples using environmental variables, but it is possible, that user`s machine/computer is differentely configured.

So, here they are:


GISBASE= C:\GRASS-64
GISRC= C:\Documents and Settings\user\.grassrc6
LD_LIBRARY_PATH= C:\GRASS-64\lib
PATH= C:\GRASS-64\etc;C:\GRASS-64\etc\python;C:\GRASS-64\lib;C:\GRASS-64\bin;C:\GRASS-64\extralib;C:\GRASS-64\msys\bin;C:\Python26;
PYTHONLIB= C:\Python26
PYTHONPATH= C:\GRASS-64\etc\python
GRASS_SH= C:\GRASS-64\msys\bin\sh.exe


1st - Drive letter. In my case it`s D:\
2nd - user. Usually it is the name of user.
3rd - Where the GRASS is stored
4th - Where the Python is stored
5th - What version of Python is used.

That`s it.

2010-12-15

Historical maps

Hey!
Long time no see.
There`re few things waiting for writing them here.
But for now - some interesting historical Near East maps
==
----
Kish hegemony (2800-2500 BC)
Ebla hegemony (2500-2250 BC)
Lagash Hegemony (2454-2342 BC)
Mesopotamia
Uruk Lugalzagesi (2342-2318 BC)
Uruk Utukhengal (2123-2113 BC)
Ur empire (2112-2004 BC)
Isin empire (2017-1925 BC)
Babylon-Isin empire (1125-1103 BC)
Eshnunna empire (1830-1815 BC)
NeoBabylon empire (626-539 BC)
Akkad empire (2334-2154 BC)
Assirian empire
Antique (1813-1781 BC)
Middle (1365-1076 BC)
Late (935-609 BC)
Paleobabylonian (1792-1640 BC)
Karduniash empire (1570-1155 BC)
Mitanni empire (1500-1350 BC)
Damascus empire (842-797 BC)
Seleucid empire (305 - 63 BC)
Palmyr empire (260-272 AD)
Umayyad empire (661-750 AD)
Abbasid empire (750-945 AD)
Zengida empire (1127-1175 AD)
Jalayarid empire (1336-1432 AD)
----
==

Take a look Here

2010-03-29

GRASS 6.4.0RC5 and raster input

When the project and mapset region is created, it is easy to import raster and vector data, even if they are not defined on GRASS specified coordinate system.

File->Import Raster Map->Multiple Formats Using Gdal
and woila - here it is - r.in.gdal (or v.in.gdal, if importing vectors).
Otherwise (faster, by the way) importing raster using command line the same command - r.in.gdal and run in GUI.
If the raster (or vector) data has no specified coordinate system, you can
1) set it using ogr2ogr or
2) ignore this fact, and check Override projection (use location`s projection) under the Options tab.

2010-03-27

six million problem...

repetition est mater studiorum.

In Latvia we have historical problems with coordinate systems. Some times we need to work in one of them, some times in other.

This ir how to set coordinate systems from one to another

I have shp file in LKS coordinates. I need to make false north 60000000.

1)Let`s set the coordinate system in file we`re working to.

ogr2ogr -a_srs EPSG:3059 /media/kratuve/gis_latvija/ARC_hydro/auce/lauks_LKS.shp /media/kratuve/gis_latvija/ARC_hydro/auce/lauks.shp


2)Let`s transfer coordinate system to WGS CoordSys.

ogr2ogr -t_srs EPSG:2100 /media/kratuve/gis_latvija/ARC_hydro/auce/lauks_WGS.shp /media/kratuve/gis_latvija/ARC_hydro/auce/lauks_LKS.shp



For raster data we can use gdalwarp instead of ogr2ogr

Interesting artefacts about ogr2ogr and gdalwarp.
Using previous example with vector data (ogr2ogr), the data transformed correctly. But when I used the same parameters in gdalwarp, the data were transformed to the north, but they were incorrectly transformed. I tried hardcoded transformation.

1)First by setting known coordinate system for file
gdalwarp -s_srs "+proj=tmerc +lat_0=0 +lon_0=24 +k=0.99960
0 +x_0=500000 +y_0=-6000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs" /media/kratuve/gis_latvija/ARC_hydro/auce/"$inputFileName".tif /media/kratuve/gis_latvija/ARC_hydro/auce/"$outputFileName"_CH.tif

2)Second transform the coordinate system by adding (or in this case subtracting, because in previous step false northing [y0] is -6M) 60000000
gdalwarp -t_srs "+proj=tmerc +lat_0=0 +lon_0=24 +k=0.99960
0 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs" /media/kratuve/gis_latvija/ARC_hydro/auce/"$outputFileName"_CH.tif /media/kratuve/gis_latvija/ARC_hydro/auce/"$outputFileName"_TR.tif


and it worked fine for me.



References:
http://www.gisnet.lv/gisnet/2007/03/datu-parprojicesana-ar-gdalogr/
http://www.gisnet.lv/gisnet/2007/04/sesu-miljonu-opera/

Additional info - bash script sample
http://paste.php.lv/eddccdff78d0d0f0a565561ce83bc6fb?lang=bash

2010-03-05

dissolve causes crash

Started messing around with vector data and I found, that qgis is frequently crashing when using vector geoprocessing tools.

Unnecessary problems are not wanted.

I found out that problems might be in python and SIP bindings. So it seems, that i should upgrade SIP and PyQt4 and then recompyle QGIS from source...
that`s sux. truly sux.

2009-10-30

what else google can do?

I wanted to see weather forecast for Milano, and I though, using google I`ll be able to find some weather forecasting homepage... But google did it quicker and gave me forecast directly.
Wanna try? Write in the google search textbox weather city name and you`ll get direct forecast for chosen city. Nice, isn`t it?

2009-10-01

Preparing to heading west..

My professor took part in EU science project, in France and he`s asking me to go with him. It is quite ok for me right now, because in that way I`ll get some money. The first thing is I have to save as much as i can. So the possibilities are Ryanair, EasyJet, rideshare, hitchhiking. I`ll have one extra bag, so hitchhiking seems difficult, but still possible.
1)I found cheap Ryanair ticket to Milano. Got it for 38.60 Eur
2)I found Eurolines from Milano to Lyon. Got it for 46.50 Eur
3)I found train ticket from Lyon to Clermont-Ferrand. Got it for 30.20 Eur
Total cost in one direction - 115.30 Eur
This is cheaper and much more fun than flying from Riga to Paris by airBaltic and paying ~180 Euros, and more 75 euros for train from Paris to Clermont-Ferrand...

But now i`ve dillemma about how to come back... have to think about it heavily, and get one important view.

//
wasn`t so easy with last one...

2009-08-19

So this is it!

Tomorrow afternoon my family will take me to Suwalki. It`s 5 and half hours driving from Riga and about 380 km through Bauska, Panevezis, passing Kaunas, Marijampole.

The train from Suwalki to Katowice costs around 21 USD. It`s about 640 km and 10 hours going by train. Polish train timetable here. The train leaves at 20:48 local time (GMT +1) So i have to calculate exact time and time reserves. And here it is, the most difficult and popular travel question. Do I have add 1 hour if i`m heading from west to east, or subtract it. In this case I`ll try to think it in Polish time zone. In Poland - 20:00, in Latvia - 21:00. I have the train in 21:48 Latvian time, so i have one more hour and I could leave Latvia at around 15:30

From Katowice (early saturday morning) I`ll heading to south-west, to Brno through Ostrava, then to northwest, to Praha. I`m not sure which way should be better going to Praha, but it seems like motorway or highway, so I`ll use petrol station.  Google maps said that i should be there in 5-6 hours.

Hope to be in Praha in the mid of saturday. I should spend night there... And the next is my goal - Regensburg. About 3 hours, 250 km from Praha.

Meet me in the sunday afternoon somewhere in Regensburg (?)

2009-07-23

Lat/Long

Solution how to find latitude and longitude using google maps is here, if you haven`t google earth ->

http://www.itouchmap.com/latlong.html

Homepage is using not very complicated OOP based javascript to find parameters, centering the map as the pointer is in the true center thus giving the true coordinats of pointer, and calculates from decimal (default in google maps) to degrees.