On Mon, 8 Jan 2024 23:50:11 -0800 (PST), सूरज गुप्ता wrote:
> Hi,
> I recently started using spatialite and initially struggled to get
> started and make the first spatialite query working.
>
> I referred to documentation, but most of it is old and not
> maintained,
> which is fine for me because I understand it takes time and effort to
> keep the documentation updated.
>
this is not entirely true: SpatiaLite is essentially the
Spatial SQL extension for SQLite, i.e. ultimately it simply
is a large collection of Spatial SQL functions.
all these SQL functions are extensively documented one by one
and the documentation is regularly updated with each version
release.
please see:
https://www.gaia-gis.it/gaia-sins/spatialite-sql-5.1.0.html
> But what I am asking is that can we have a getting started page in
> docs, where we can show how to make first query working
> in spatialite.
>
they are certainly a little aged, but starting from the study
of the Cookbook is always an excellent starting point.
There are even two different versions:
https://www.gaia-gis.it/gaia-sins/spatialite-cookbook/index.html
https://www.gaia-gis.it/gaia-sins/spatialite-cookbook-5/cookbook_topics.01.html
> Ex. Problems that I faced
> When starting with creating a column, we have to use
> "AddGeometryColumn" function, but that didn't worked for me in
> starting because I didnt initilized spatilite with
> "InitSpatialMetaDataFull", because it is not mentiond in docs that
> first we have to initilize spatilite.
>
This is a detail that critically depends on the software
you are using.
if you used spatialite_gui (as most users do) there would have
been no need to initialize the new DB because the app will
automatically take care of it when it is created.
>
> Again the same happened with "AsGeoJSON" function. I am working with
> javascript, so I needed the geometry data in JSON format, while
> retrival of geometry columns with plain select query I used to get
> binary data but I needed it in JSON, again in docs I didn't found any
> referece for selecting data with AsGeoJSON.
>
I'm really sorry, but I very much doubt that the majority
of SpatiaLite users are particularly interested in GeoJSON
functions, which is an interesting format only for web
developers.
I have no doubt that it is a fundamental aspect for you,
but the majority of users seem much more interested in
data processing and spatial analysis.
Tip: looking for "JSON" in the HTML list of SQL functions
would have taken you a few seconds to understand which
functions are available for this particular format and how
to use them.
Conclusion: Spatial SQL is not an easy subject, especially
for those who don't know it at all.
But experience says that with a week of methodical study
you always end up understanding how it works.
bye Sandro