How to find a point(x,y) inside a irregular polygon using Oracle10g Spatial function or any other API - oracle10g

I am very new in working with GIS or geometry data. I have geometry data (polygon) in oracle10g database. Is there any Spatial function to find a point inside that polygon. If not then any tool like geotools for .Net or any other API can help me. The polygon can have hole inside it. So point must be in a polygon area.
Thanks in advance for your help
Naym

Have you looked at Oracle Locator? The query syntax is awful to read, but it is capable of doing "is point in polygon" queries. You'll need to create a spatial index column on any table that you want to run a spatial query against. Reading the documentation is a must, because it is a pain to get working initially.

Related

PostGIS - find intersections in space and time

I store GPS tracks in Postgres with PostGIS and would like to find intersections between them not just in space but also in time. I'm thinking of using 3D geometry but treat 3rd coordinate as time. Basically as soon as new data comes I insert POINT(lat, lon, t) into a GPS track. To find intersections I make a query to find nearby objects along the path (a LINESTRING).
Based on what I know about PostGIS and spatial indexes it should work just fine. From the other side this kind of unorthodox usage of a spatial coordinate makes me a bit nervous. Is it ok to use PostGIS this way or there are better way to do what I want?

Best Practice to display local markers and a wider area of points of interest markers?

I've created a base layer and 6 different overlay (Points of Interest) layers for a leaflet map.
The base layer of markers can appear on the map almost anywhere in the world, but I want the POI layers to appear only if they are in the same area (mapBounds) of the base layer. Probably the screen size.
All the data is pulled from a MySQL database and using Ajax I create the various sets of markers from two different tables, base and poi. This much is all done and working, you can see it at https://net-control.us/map2.php. The green and blue markers are from the base table, other markers are currently selected for view by clicking on the appropriate icon in the lower right. The only one active at the moment is 'Fire Station'. But if you zoom out far enough you will see additional fire stations in the Kansas City area, and in Florida. Those sets are not needed.
After the query runs I create a fitBounds variable of the base layer and another poiBounds for the poi layer. But I'm not sure I need the poiBounds. The number of base markers is generally less than 50 for the base query, but if all the poi markers are pulled world wide that number could be very large.
So I'm hoping someone can help me determine a best practice for this kind of scenario and maybe offer up an example of how it should be done. Should I...
1) Download all POIs and not worry about them appearing outside the base bounds layer? Should I inhibit them from showing in the javascript or in the SQL? How?
2) If I inhibit the unwanted points from SQL do I test one POI at a time to see if its included in the base bounds? How? Are there MySQL functions perhaps to work with this kind of data?
I'm fairly new at leaflet maps and would appreciate examples if appropriate.
2) If I inhibit the unwanted points from SQL do I test one POI at a time to see if its included in the base bounds? How? Are there MySQL functions perhaps to work with this kind of data?
You probably want a column of type POINT, a spatial index on such column (which internally is likely to be implemented as an R-Tree), and spatial relation functions on your SQL query to make use of that index.
Start by reading https://dev.mysql.com/doc/refman/8.0/en/spatial-types.html. Take your time, as spatial databases, spatial data types and spatial indices work a bit differently than their non-spatial equivalents.

Can I use PostGIS for a custom world?

I have the need to store 3D objects in a user defined space but I am having difficulty with the idea of creating a user defined world with PostGIS. Can I create a virtual world using PostGIS to leverage all of the spatial math functions and indexes without having to place my "world" on the surface of the earth? I would be ok with this world existing at the center of the earth if I had to.
Goals:
Store rectangular prisms in a user defined 3D space/coordinate system.
Have sub-coordinate systems within another coordinate system
Calculate intersections of said rectangular prisms and other spatial calculations.
Load information from a CAD drawing into a database
Is this possible with PostGIS? There is so much information out there that it is hard to consume so I would appreciate any type of answer suggesting do-able but difficult, easily do-able, or go a completely different direction than PostGIS. Thanks in advance.

reproject layers in openlayers 3

I downloaded some data from OpenStreetMap and put them in PostGIS a couple of months ago. In all the tables that contain spatial data, the spatial column is way geometry(Geometry,900913) In Geoserver, native SRS is EPSG:900913 so I guess the EPSG of the data is 900913.
In my Openlayers 3.9.0 , the projection is left to default (EPSG:3857).
I want to create a tiled WMS layer of the PostGIS data.
By setting params: {'CRS': 'EPSG:3857'}, in the layer , will this automatically reproject it from 900913 to 3857, or I have to do some extra work?
Thanks
The SRID 900913 was originally "defined" by OpenStreetMap for the projection Google Maps was using (replace G with 9, squint while looking at it, and let your mind wander over it). Later, EPSG added that SRS to their database but using code EPSG:3857. So they are identical.
I am not sure if OpenLayers is smart enough to do a no-op when data with SRID=900913 needs to be displayed as SRID=3857. Just to make your life easier, update your way columns in PostGIS to use SRID=3857. You can use ST_SetSRID() for that.

Proper way of representing UTM coordinates in Grails / GORM / PostgreSQL and working with them

I need to store the geographic location of a few physical locations in my Grails/GORM/PostgreSQL based software.
Not a whole lot (about a 100), and there won't be any geo-spatial searches or calculations based on them (although I will have to render them onto a map - probably using a HTML5 canvas).
What are my options for representing and storing them in the GORM object model and in PostgreSQL? Which one is the best?
The incoming format for the coordinates is UTM so something like "29U E 323 314.000 N 3232 111.000". Storing this as text seems bad.
I've looked at PostGIS but I'm concerned it is a bit of overkill (as I need no real geospatial queries) and I'm not sure it integrates with GORM well.
Is there a Java (or Grails) standard simple library for working with coordinates? I've looked at GeoTools and OpenMap so far, and some others which appeared abandoned.
Right now I'm thinking using one of these libraries to transform my UTM coordinates to latitude/longitude, and store those as a pair of doubles - then figure out a way how to project those onto a map again when it comes time to render.
This tutorial and sample class solved my needs for coordinate conversion:
http://www.ibm.com/developerworks/java/library/j-coordconvert
Now I'm storing a location object with latitude/longitude doubles (as embedded) in database, and plan to stick with that.
Rendering to a HTML5 canvas (thus another set of coordinate translation) is still outstanding though.
P.S. GeoTools has a very complex API, OpenMap appear to hate Maven ("We prefer SVN").