Skip to content

Instantly share code, notes, and snippets.

View quommit's full-sized avatar

José Tomás Navarro Carrión quommit

View GitHub Profile
@quommit
quommit / gist:4573145
Created January 19, 2013 15:25
SIGUA WFS service request by bounding box: University of Alicante Faculty of Science VI building, floor 1
http://www.sigua.ua.es/cgi-bin/siguawms?SERVICE=WFS
&VERSION=1.0.0
&REQUEST=GetFeature&TYPENAME=P1
&SRSNAME=EPSG:23030
&BBOX=716857,4251930,716963,4251990
@quommit
quommit / gist:4573212
Created January 19, 2013 15:38
SIGUA WFS service request using Filter Encoding: University of Alicante Faculty of Science VI building, floor 1
http://www.sigua.ua.es/cgi-bin/siguawms?SERVICE=WFS
&VERSION=1.0.0
&REQUEST=GetFeature&TYPENAME=P1
&SRSNAME=EPSG:23030
&FILTER=
<Filter>
<PropertyIsLike wildCard="*" singleChar="#" escapeChar="!">
<PropertyName>codigo</PropertyName>
<Literal>0041P1*</Literal>
</PropertyIsLike>
@quommit
quommit / gist:4584740
Last active December 11, 2015 10:08
SIGUA attribute queries for polygon classification by use category according to DB-SI criteria. These are ad hoc queries for University of Alicante Faculty of Science VI, floor 1. Expressed in pseudo-code.
//Query passageways (P) in enclosure set (U)
//Use category identifiers: 97 (lobbies), 98 (hallways)
var P = from item in U
where U.actividad.EqualsAny (97, 98)
select item;
//Query potentially crowded rooms (E) in enclosure set (U)
//Use category identifiers: 1 (lecture rooms), 5 (research labs), 9 (libraries or reading rooms)
var E = from item in U
where U.actividad.EqualsAny (1, 5, 9)
@quommit
quommit / gist:4589233
Created January 21, 2013 20:51
Pseudo-code for an access point calculation function from pairs of SIGUA enclosures.
function GetAccessPoint (polygon1, polygon2, useId1, useId2, useCategoryMatrix)
{
//Store the access type. Domain values are None, Exit or EvacuationOrigin
var accessType = useCategoryMatrix [useId1, useId2];
if ( accessType == None) {
return; //the pair of use category identifiers do not yield an access point
}
else if (polygon1.Touches (polygon2) == false) {
return; //the pair of polygons do not have an edge in common
}
@quommit
quommit / gist:4596403
Last active November 8, 2022 10:51
Sample C# code for indexing a series of polygon vertices using Z-order. In order to compile this code, download and reference NetTopologySuite, an open source spatial analysis library.
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using GeoAPI.Geometries;
using NetTopologySuite.Geometries;
using NetTopologySuite.IO;
using NetTopologySuite.Densify;
namespace MortonOrder
@quommit
quommit / gist:4605752
Created January 23, 2013 13:45
Pseudo-code for a medial axis transform algorithm based on Voronoi diagram.
//Get point cloud S from polygon P
//by running a densify operation
var S = P.Densify ();
//Create Voronoi diagram V for
//point cloud S
var V = Voronoi (S);
//Get intersection C of Voronoi diagram V
//with polygon P
@quommit
quommit / gist:4605854
Last active July 25, 2022 19:31
Sample C# code implementing medial axis transform of a polygon using Voronoi diagram. In order to compile this code, download and reference NetTopologySuite, an open source spatial analysis library.
using System;
using System.Collections.Generic;
using GeoAPI.Geometries;
using NetTopologySuite.Geometries;
using NetTopologySuite.IO;
using NetTopologySuite.Densify;
using NetTopologySuite.Triangulate;
namespace Skeleton
{
@quommit
quommit / gist:4633786
Last active April 19, 2017 06:04
C# routing application for calculating a set of shortest paths from a series of predefined start and end locations. Each start node can be assigned an integer load value which accumulates on its corresponding end node. In order to compile this code, download and reference NetTopologySuite, an open source spatial analysis library, and QuickGraph,…
using System;
using System.Collections.Generic;
using System.IO;
using GeoAPI.Geometries;
using NetTopologySuite.Features;
using NetTopologySuite.Geometries;
using NetTopologySuite.IO;
using System.Globalization;
namespace ShortestPath
@quommit
quommit / gist:7320755
Created November 5, 2013 15:28
How to create a hash using ServiceStack.Redis
using System;
using System.Globalization;
using System.Collections.Generic;
using ServiceStack.Redis;
using ServiceStack.Redis.Generic;
using ServiceStack.Text;
using System.Linq;
namespace redisw
{
@quommit
quommit / cat2redis
Last active August 29, 2015 14:10
Generar Nomenclator de referencias catastrales en Redis
from argparse import ArgumentParser
import os
from lxml import etree
import redis
EXEC_DIR = os.path.dirname(__file__)
root = "/home/josetomas/Descargas/catastro_alicante_2014"
gmdns = "{http://www.isotc211.org/2005/gmd}"