Difference between revisions of "Opasnet map"

From Testiwiki
Jump to: navigation, search
(Wiki maps)
(See also)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[[Category:Opasnet]]
 
[[Category:Opasnet]]
 
[[Category:Code under inspection]]
 
[[Category:Code under inspection]]
{{variable|moderator=Jouni|stub=Yes}}
+
[[Category:R tool]]
 +
[[Category:Modelling]]
 +
{{method|moderator=Jouni|stub=Yes}}
  
 
== Question ==
 
== Question ==
Line 96: Line 98:
  
 
==== GoogleMaps Sorvi MML ====
 
==== GoogleMaps Sorvi MML ====
 
{{attack|#|Something wrong with sorvi.|--[[User:Jouni|Jouni]] ([[User talk:Jouni|talk]]) 12:54, 23 December 2013 (EET)}}
 
  
 
<rcode name='gmapspsqltest3'>
 
<rcode name='gmapspsqltest3'>
Line 105: Line 105:
 
library(sorvi)
 
library(sorvi)
 
library(rgdal)
 
library(rgdal)
 +
library(maptools)
  
data(MML)
+
shp <- LoadData("kuntarajat.maa.shp")
 
 
shp <- MML[["1_milj_Shape_etrs_shape"]][["kunta1_p"]]
 
  
 
#epsg3857String <- CRS("+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +a=6378137 +b=6378137 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs")
 
#epsg3857String <- CRS("+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +a=6378137 +b=6378137 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs")
Line 115: Line 114:
 
shp2<-spTransform(shp,epsg4326String)
 
shp2<-spTransform(shp,epsg4326String)
  
out<-sapply(slot(shp2,"polygons"),function(x
+
out<-sapply(slot(shp2,"polygons"),function(x)
 
{kmlPolygon(
 
{kmlPolygon(
 
x,
 
x,
Line 424: Line 423:
 
* [https://gist.github.com/2292662 Plotting sp-objects to Google Maps with different CRSs]
 
* [https://gist.github.com/2292662 Plotting sp-objects to Google Maps with different CRSs]
 
* [http://semantic-mediawiki.org/wiki/Special:MapEditor Map editor]
 
* [http://semantic-mediawiki.org/wiki/Special:MapEditor Map editor]
 +
* [http://www.findlatitudeandlongitude.com/batch-geocode/ Batch geocoding]: give addresses, the website will provide geolocations. Works for a few hundred addresses.
  
 
==Keywords==
 
==Keywords==

Latest revision as of 11:29, 1 November 2016



Question

How should GIS data be handled and visualised in Opasnet?

Answer

  • Original GIS data is stored in a PostgreSQL database.
  • Data is accessed by R using the RGDAL package and ?? connection.
  • Data in manipulated in R.
  • Ovariables are converted to SpatialPointsDataFrame objects using ova2spat function.
  • Data is displayed by producing a KML file with ?? package.
    • The KML file is created with MyPointKML function, if pins are shown.
    • The KML file is saved at the R-tools server.
    • Google Maps is used to show the KML file on a web page.

Currently, ova2spat and MyPointKML functions are located in OpasnetUtils/Drafts. Therefore, you need this command:

objects.latest("Op_en6007", code_name = "answer") # OpasnetUtils/Drafts. We need MyPointsKML and ova2spat.

This is the projection that the National Land Survey Finland uses: [1].

Key guidance:


Rationale

Wiki maps

Loading map...


Loading map...

Map editor and instructions

Calculations

Kuopio buildings with Google pin map

#: In function google.point_kml, parameter name is not used for anything! --Jouni (talk) 08:42, 26 December 2013 (EET)

#: What we need is a function that eats SpatialPointDataFrames and gives KML files with the data points in different formats (pins, coloured marks etc. --Jouni (talk) 08:42, 26 December 2013 (EET)

+ Show code

GoogleMaps Sorvi MML

+ Show code

Google with shapefiles

+ Show code

Google show data from url on map

+ Show code

Google circles

+ Show code

Rasters on Google maps

+ Show code

Static GoogleMaps

+ Show code

See also

Keywords

References


Related files

<mfanonymousfilelist></mfanonymousfilelist>