Skip to content

Instantly share code, notes, and snippets.

View jgrocha's full-sized avatar
🏠
Working from home

Jorge Gustavo Rocha jgrocha

🏠
Working from home
  • Geomaster, Lda
  • Braga, Portugal
View GitHub Profile
@jgrocha
jgrocha / servidor.py
Created June 8, 2015 08:30
Moon phases based on pyephem
#-*- 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
<?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 June 4, 2019 22:37
fix github issue references on QGIS repo
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
psql services=pg_trabalho
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()
"""
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
@jgrocha
jgrocha / description
Created June 30, 2018 09:17
Scaleway
Can not attched a volume
@jgrocha
jgrocha / qgis screenshot.png
Last active February 24, 2018 12:14
multiplolygon sample
[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 December 3, 2017 11:33
Feedback about missing spatial indexes on Postgis
add postgis table dialog.png