Skip to content

Instantly share code, notes, and snippets.

View juanluisrp's full-sized avatar

Juan Luis Rodríguez Ponce juanluisrp

View GitHub Profile
@juanluisrp
juanluisrp / gist:3928064
Created October 21, 2012 18:46
Convert from utm to lat,lon
// include the library
<script src="lib/proj4js-combined.js"></script> //adjust the path for your server
//or else use the compressed version
. . .
// creating source and destination Proj4js objects
// once initialized, these may be re-used as often as needed
var dest = new Proj4js.Proj('EPSG:4236'); //source coordinates will be in Longitude/Latitude
var zone29 = new Proj4js.Proj('EPSG:23029'); //destination coordinates in UTM zone 29
@juanluisrp
juanluisrp / gist:4384845
Created December 27, 2012 02:06
Properly setting of externalGraphic size in OpenLayers.
var myStyles = new OpenLayers.StyleMap(
new OpenLayers.Style(
{
externalGraphic: baseUrl +'/img/marker-blue.png',
fill: false,
stroke: false,
pointRadius: 0,
graphicWidth: 18 ,
graphicHeight: 30,
fillOpacity: 1,
@juanluisrp
juanluisrp / create_template_postgis.sh
Last active December 11, 2015 21:49 — forked from rolo/gist:1481128
Install Postgres and create template_postgis
#!/bin/bash
#
# Install Postgres 9.1, PostGIS and create PostGIS template on a clean Ubuntu 11.10 Oneiric Ocelot box
# http://wildfish.com
# add the ubuntu gis ppa
sudo apt-get -y install python-software-properties
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
import org.apache.commons.io.FileUtils;
import java.io.File;
public class DeleteDirectory {
@juanluisrp
juanluisrp / map.geojson
Created August 12, 2013 20:07
via:geojson.io
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# tomcat recipe comes from https://github.com/opscode-cookbooks/tomcat
include_recipe "tomcat::default"
template "/tmp/template1" do
source "default.erb"
owner "root"
group "root"
mode "0644"
notifies :restart, "service[tomcat]", :delayed
end
@juanluisrp
juanluisrp / centos-openstack-post-install-script
Created January 9, 2015 15:01
Openstack post installation script to set a password for root and cloud-user on CentOS
#cloud-config
chpasswd:
list: |
root:stackops
cloud-user:stackops
expire: False
ssh_pwauth: True
@juanluisrp
juanluisrp / deployGeonetwork.sh
Created December 4, 2015 22:39
Update, compile and deploy GeoNetwork into Tomcat
#!/bin/bash
GN_SOURCES=geonetwork
GN_PROFILES=env-prod
DEPLOY_NAME=geonetwork-ngr3
GN_DATA_DIR=/var/local/geonetwork/${DEPLOY_NAME}
RED='\e[31m'
EC='\e[0m'
@juanluisrp
juanluisrp / config-view-service-override.xml
Created December 28, 2018 09:36
Overrides xml.metadata.get service to return geonet:info elements
<overrides xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="config-overrides.xsd">
<file name=".*/WEB-INF/config/config-service-xml-api.xml">
<replaceAtt xpath="services/service[@name='xml.metadata.get']/class/param[@name='skipInfo']" attName="value" value="n"/>
</file>
</overrides>