I'm looking for a free and reasonably licensed alternative to ArcGIS Desktop (or maybe just ArcGIS Server). I'm quite new to GIS, so I'll state some of the things I want to be able to do and you can tell me what alternatives are out there. I need to be able to convert from GML or Shapefile format to some GIS database format, (I bet I cant do this with GDAL/OGR but I'm not sure). And then I want to be able to programmatically query the database for assets of certain types within specified bounds. For instance, I would like to find all roads within a lat/long box and extract their names and their polyline representations.
At this point I am only interested in a programmatic API. I'm not interested in anything with a GUI.