Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Jorge Gustavo Rocha jgrocha

🏠
Working from home
  • Geomaster, Lda
  • Braga, Portugal
View GitHub Profile
@jgrocha
jgrocha / servidor.py
Created Jun 8, 2015
Moon phases based on pyephem
View servidor.py
#-*- coding: utf-8 -*-
from BaseHTTPServer import BaseHTTPRequestHandler
import urlparse
import ephem, datetime
import json
# Phases of the Moon, using the datetime.now() at UTC
# http://127.0.0.1:8899/
# Phases of the Moon, using the datetime.datetime(int(year), int(month), int(day))) at UTC
View GetProjectSettings.xml
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="http://qgis.demo:80/cgi-bin/qgis_mapserv.fcgi?MAP=postgresql:?service=pg_geotuga&sslmode=disable&schema=public&project=depende&amp;SERVICE=WMS&amp;REQUEST=XSL"?>
<WMS_Capabilities xmlns:sld="http://www.opengis.net/sld" xmlns:qgs="http://www.qgis.org/wms" version="1.3.0" xmlns="http://www.opengis.net/wms" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wms http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/sld_capabilities.xsd http://qgis.demo/cgi-bin/qgis_mapserv.fcgi?MAP=postgresql%3A%3Fservice%3Dpg_geotuga%26sslmode%3Ddisable%26schema%3Dpublic%26project%3Ddepende&amp;SERVICE=WMS&amp;REQUEST=GetSchemaExtension">
<Service>
<Name>WMS</Name>
<KeywordList>
<Keyword vocabulary="ISO">infoMapAccessService</Keyword>
</KeywordList>
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink"
@jgrocha
jgrocha / github_candidates.csv
Last active Jun 4, 2019
fix github issue references on QGIS repo
View github_candidates.csv
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
github
29637
29598
29511
29374
28865
28564
28546
28545
28382
View psycopg2
import psycopg2
connection = psycopg2.connect(service='pg_trabalho')
# connection = psycopg2.connect(user = "cmb.user", password = "xxxxxxxx", host = "192.168.1.24", port = "5432", database = "trabalho")
cursor = connection.cursor()
# Print PostgreSQL Connection properties
print ( connection.get_dsn_parameters(),"\n")
# Print PostgreSQL version
cursor.execute("SELECT version();")
record = cursor.fetchone()
View qgis3_standalone_osx.py
"""
Standalone python script for QGIS3 on OSX.
"""
import os
import sys
# Define plugin locations from QGIS3
sys.path.append('/Applications/QGIS3.app/Contents/Resources/python/')
sys.path.append('/Applications/QGIS3.app/Contents/Resources/python/plugins')
# Define Qt5 plugin path since Qt5 can't find it
View description
Can not attched a volume
@jgrocha
jgrocha / qgis screenshot.png
Last active Feb 24, 2018
multiplolygon sample
View qgis screenshot.png
[https://gis.stackexchange.com/questions/257974/postgis-multipolygon-when-converted-to-shapefile-doesnt-match-the-source-geomet PostGIS Multipolygon when converted to shapefile doesn't match the source geometry]
@jgrocha
jgrocha / add postgis table dialog.png
Last active Dec 3, 2017
Feedback about missing spatial indexes on Postgis