Skip to main content
Bumped by Community user

Based on the following tables:

Street

Street

Municipality

Municipality

I'd like to populate Street.NOM_ENTStreet.NOM_ENT with Municipality.NOM_ENTMunicipality.NOM_ENT and Street.NOM_MUNStreet.NOM_MUN with Municipality.NOMBREMunicipality.NOMBRE any time Street.geomStreet.geom is within Municipality.geomMunicipality.geom.

In other words, I have a table with all the streets in a country and I need to add to witchwhich state and county that street belongs.

I know how to check if Street.geomStreet.geom is within Municipality.geomMunicipality.geom, but I'm kind of new working with postgis/postgres and I'm not sure how to use this as a condition for an UPDATE query.

Based on the following tables:

Street

Street

Municipality

Municipality

I'd like to populate Street.NOM_ENT with Municipality.NOM_ENT and Street.NOM_MUN with Municipality.NOMBRE any time Street.geom is within Municipality.geom.

In other words, I have a table with all the streets in a country and I need to add to witch state and county that street belongs.

I know how to check if Street.geom is within Municipality.geom, but I'm kind of new working with postgis/postgres and I'm not sure how to use this as a condition for an UPDATE query.

Based on the following tables:

Street

Street

Municipality

Municipality

I'd like to populate Street.NOM_ENT with Municipality.NOM_ENT and Street.NOM_MUN with Municipality.NOMBRE any time Street.geom is within Municipality.geom.

In other words, I have a table with all the streets in a country and I need to add to which state and county that street belongs.

I know how to check if Street.geom is within Municipality.geom, but I'm kind of new working with postgis/postgres and I'm not sure how to use this as a condition for an UPDATE query.

naming
Link
Vince
  • 20.3k
  • 16
  • 48
  • 65

Can I use STWithinST_Within or STContainsST_Contains to update columns based on a geom being within another?

Source Link

Can I use STWithin or STContains to update columns based on a geom being within another?

Based on the following tables:

Street

Street

Municipality

Municipality

I'd like to populate Street.NOM_ENT with Municipality.NOM_ENT and Street.NOM_MUN with Municipality.NOMBRE any time Street.geom is within Municipality.geom.

In other words, I have a table with all the streets in a country and I need to add to witch state and county that street belongs.

I know how to check if Street.geom is within Municipality.geom, but I'm kind of new working with postgis/postgres and I'm not sure how to use this as a condition for an UPDATE query.