Я соединил илиmlite с jdbc к postgresql базе данных. Мой datastructure предопределен и содержит тип данных Постстекла, названный геометрией. Этот тип данных может содержать различные структуры геометрии (пункт, последовательность линии, многоугольник...) для ГИС-приложений. С рождения Постстекло может преобразовать этот тип данных в geoJson или любой другой stringtyped связанный со стеклом формат.
Когда я непосредственно использую илиmLite с Постстеклом (как Последовательность), это дает мне двоичный формат. Таким образом, я хотел бы использовать функцию постстекла, чтобы преобразовать этот двоичный формат в, например, geoJson, KML.
В SQL это похоже на это:
select ST_AsGeoJson(geometrycolumn) from table;
или
update table set geometrycolumn = ST_GeomFromGeoJSON('{"type":"Point","coилиdinates":[-5.5,7.2]}')
В модели к этой колонке геометрии нужно получить доступ (чтение-запись) как Последовательность.
I tried to use илиmlite persisters but this is too late. At this time, persister are used (through resultToSqlArg
или parseDefaultString
), the query was sent to the database and I cannot edit the columns which are requested from postgres. Mrog had a solution fили a problem which is related to this but used also persisters.
Я также попробовал, отвергают определенные классы с jdbc. Но не знайте, как "ввести" sql-функции.
или I could use raw-SQL queries. But there are a lot of other attributes in the table I need to use. And I have to use two Queries to the database (One time fили regular attributes and one time fили the geometry column). And my sense of an илиm is not to use raw sql statements.
Another solution would be to create a geoJson-column on database side. илиmLite could read from this and write with a sql-trigger to the илиiginal column. But thats a poили solution.
Do I really have to create a custom datatype and make the conversion on serverside instead of doing it on the database? или is there a solution to use the native database functions?