Irmante Astalavista

Simsalabim!!!
Blog ini bercerita tentang dunia IT, ilmu kebumian, dan lain-lain.

Thursday, April 24, 2008

SRID dan MySQL problem

Perintah berikut ditujukan untuk menghitung distance obyek garis (Linestring) yang disimpan dalam kolom geometry 'G' pada tabel GEOM.
Acuan kodenya adalah perintah LineFromText(wkt[,srid])
dimana wkt merupakan obyek geometri dalam format WKT/WKB.
dan kode SRID merupakan kode Spatial Reference ID.

Gw coba perintah ini:

SELECT GLength(LineFromText(asText(g), 4236)) FROM geom LIMIT 0, 30
outputnya: 
0.012685477748776
0.0087030137100028


SELECT GLength(LineFromText(asText(g), 1)) FROM geom LIMIT 0, 30
outputnya:
0.012685477748776
0.0087030137100028

Liat dua hasil output di atas, nilai outputnya sama kan...

Pdhl saya sudah memberikan kode SRID yang berbeda, dimana kode '1' itu kode SRID sesuai tabel spatial_ref_sys. Yang '4236' merupakan kode EPSG WGS 1984. Meski menggunakan MySQL seri 5.xx tyt perhitungan jarak/luas/dimensi/perimeter
mengacu pada planar coordinate system TIDAK mengacu pada kode EPSG/SRID.

Sesuai kalimat yang ditulis dlm manualnya:
Its SRID, or Spatial Reference Identifier. This value identifies the geometry's associated Spatial Reference System that describes the coordinate space in which the geometry object is defined.
In MySQL, the
SRID value is just an integer associated with the geometry value. All calculations are done assuming Euclidean (planar) geometry. Its coordinates in its Spatial Reference System, represented as double-precision (eight-byte) numbers. All non-empty geometries include at least one pair of (X,Y) coordinates. Empty geometries contain no coordinates.
Coordinates are related to the SRID. For example, in different coordinate systems, the distance between two objects may differ even when objects have the same coordinates, because the distance on the planar coordinate system and the distance on the geocentric system (coordinates on the Earth's surface) are different things.


Pantesan Mapserver supportnya ke Postgis, SRID itu menjadi kata kunci akurasi proyeksi. Yah... kita tunggu saja kelanjutan perkembangan mysql spatial :D

Labels: ,


0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home