Creating square box polygon from Geography/Geometry Point

  • Hi,

    I have a set of world grid points (lat/long) values. For each point, I have a 'geography' point and a 'geometry' point representation.

    I would like to create a 10 km square ploygon around each point with the point being in the middle.

    I know that I can use STBuffer() to create a 10km circle around each point, but I need to create a 10 km square around each point.

    Anyone know how to do this using either the geography or geometry points?

    Thanks in advance,

    Darrin

  • Hi Darrin

    Try the following

    SELECT geometrycolumn.STBuffer(5000).STEnvelope()

    FROM spatialtable

    This will only work with Geometries not Geographies. I could probably come up with something to do a rough extent on a geography if required.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply