This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// usings | |
public namespace Fulano | |
{ | |
[TestFixture] | |
public class TesteAzimute() | |
{ | |
// Lembre-se: | |
// 0 graus ou 360 = Norte | |
// 90 graus = Leste |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// configure os usings de acordo!!! | |
using ESRI.ArcGis.Geometry; | |
public class CalculaAzimute | |
{ | |
public CalculaAzimute() | |
{} | |
public double CalcularAzimute(IPoint de, IPoint para) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CalculadoraAzimuteDistancia(object): | |
""" | |
Calcula o azimute entre dois pontos | |
""" | |
def distancia(self, p1, p2, h1=0, h2=0): | |
""" | |
Calcula p1 distância entre dois pontos p1 e p2 | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "instalando postgresql" | |
sudo apt-get update | |
sudo apt-get upgrade | |
sudo apt-get -y -q install postgresql-9.1 postgresql-contrib-9.1 libpq-dev postgresql-server-dev-9.1 g++ libxml2-dev | |
echo "instalando postgis" | |
mkdir postgis | |
cd postgis/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OpenLayers.Format.TastyPie = OpenLayers.Class(OpenLayers.Format.JSON, { | |
geoJsonReader : new OpenLayers.Format.GeoJSON(), | |
geometryField : null, | |
read : function(json, type, filter) { | |
var results = null; | |
var obj = null; | |
if (typeof json == "string") { | |
obj = OpenLayers.Format.JSON.prototype.read.apply(this, | |
[json, filter]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def partition(v, left, right): | |
i = left | |
for j in range(left + 1, right + 1): | |
if v[j] < v[left]: # Se um elemento j for menor que o pivo | |
i += 1 # .. incrementa-se i | |
v[i], v[j] = v[j], v[i] # .. e troca o elemento j de posicao o elemento i | |
v[i], v[left] = v[left], v[i] # O pivo e' colocado em sua posicao final | |
return i | |
def quicksort(v, left, right): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def azimute_puissant(self, p1, p2): | |
""" | |
Calcula azimute puissant | |
""" | |
f = 0.00335281068118 | |
inv_f = 298.257222101 | |
e2 = 0.00669438002290 | |
a = 6378137 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def azimute_reto(self,p1, p2, casas=3): | |
# guarda para nao entramos em loop infinito. | |
if casas > 15: | |
return None | |
delta_x = round(p2.x - p1.x, casas) | |
delta_y = round(p2.y - p1.y, casas) | |
if delta_x == 0 and delta_y == 0: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def azimute_reto(self,p1, p2): | |
print "reto" | |
delta_x = round(p2.x - p1.x, 2) | |
delta_y = round(p2.y - p1.y, 2) | |
print "dX", delta_x | |
print "dY", delta_y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"F67-M-0639";19;0.001;0.001;0.001;5;"01010000A0421200003E711617393B46C027A4CC2EA69D34C0A4703D0AD7436A40";"POINT(-44.4626797542173 -20.6158169984448)" | |
"F67-M-0641";19;0.001;0.001;0.001;5;"01010000A0421200008992C220C43846C092CA5CCBA29D34C0A4703D0AD7436A40";"POINT(-44.4434853506146 -20.6157652951757)" | |
"F67-P-0643";19;0.001;0.001;0.001;7;"01010000A042120000B3A63406C23846C09049106F28A234C0A4703D0AD7436A40";"POINT(-44.4434211499296 -20.6334294714703)" | |
"F67-P-0644";19;0.001;0.001;0.001;7;"01010000A042120000760CC305C23846C07693206329A234C0A4703D0AD7436A40";"POINT(-44.4434210970293 -20.6334440187961)" | |
"F67-V-0645";28;0.001;0.001;0.001;6;"01010000A0421200007B184B05C23846C02D8DD5642AA234C0A4703D0AD7436A40";"POINT(-44.4434210411718 -20.6334593793264)" | |
"F67-V-0646";28;0.001;0.001;0.001;6;"01010000A04212000061C28904C23846C0EF7632042CA234C0A4703D0AD7436A40";"POINT(-44.4434209511426 -20.633484136887)" | |
"F67-M-0642";19;0.001;0.001;0.001;5;"01010000A04212000010162FE7C03846C00E3A28E690A434C0A4703D0AD7436A40";"POINT(-44.443386934 |